pyvttbl.plotting
API¶
Description¶
pyvttbl.plotting
contains a collection of functions for
visualizing data in DataFrame
objects.
Static Plotting Methods¶
Methods to get data into a DataFrame
, manipulate and manage data,
and write data.
- plotting.box_plot(val, factors=None, where=None, fname=None, output_dir='', quality='medium')¶
Makes a box plot
- args:
- df:
a pyvttbl.DataFrame object
- val:
the label of the dependent variable
- kwds:
- factors:
a list of factors to include in boxplot
- where:
a string, list of strings, or list of tuples applied to the DataFrame before plotting
- fname:
output file name
- quality:
{‘low’ | ‘medium’ | ‘high’} specifies image file dpi
- plotting.histogram_plot(val, where=None, bins=10, range=None, density=False, cumulative=False, fname=None, output_dir='', quality='medium')¶
Makes a histogram plot
- args:
key: column label of dependent variable
- kwds:
where: criterion to apply to table before running analysis
bins: number of bins (default = 10)
range: list of length 2 defining min and max bin edges
- plotting.interaction_plot(val, xaxis, seplines=None, sepxplots=None, sepyplots=None, xmin='AUTO', xmax='AUTO', ymin='AUTO', ymax='AUTO', where=None, fname=None, output_dir='', quality='low', yerr=None)¶
makes an interaction plot
- args:
- df:
a pyvttbl.DataFrame object
- val:
the label of the dependent variable
- xaxis:
the label of the variable to place on the xaxis of each subplot
- kwds:
- seplines:
label specifying seperate lines in each subplot
- sepxplots:
label specifying seperate horizontal subplots
- sepyplots:
label specifying separate vertical subplots
- xmin:
(‘AUTO’ by default) minimum xaxis value across subplots
- xmax:
(‘AUTO’ by default) maximum xaxis value across subplots
- ymin:
(‘AUTO’ by default) minimum yaxis value across subplots
- ymax:
(‘AUTO’ by default) maximum yaxis value across subplots
- where:
a string, list of strings, or list of tuples applied to the DataFrame before plotting
- fname:
output file name
- quality:
{‘low’ | ‘medium’ | ‘high’} specifies image file dpi
- yerr:
{float, ‘ci’, ‘stdev’, ‘sem’} designates errorbars across datapoints in all subplots
- plotting.scatter_matrix(variables, alpha=0.5, grid=False, diagonal=None, trend='linear', alternate_labels=True, fname=None, output_dir='', quality='medium', **kwds)¶
Plots a matrix of scatterplots
- args:
- variables:
column labels to include in scatter matrix
- kwds:
- alpha:
amount of transparency applied
- grid:
setting this to True will show the grid
- diagonal:
‘kde’: Kernel Density Estimation
‘hist’: 20 bin Histogram
None: just labels
- trend :
None: no model fitting
‘linear’: f(x) = a + b*x (default)
‘exponential’: f(x) = a * x**b
‘logarithmic’: f(x) = a * log(x) + b
‘polynomial’: f(x) = a * x**2 + b*x + c
‘power’: f(x) = a * x**b
- alternate_labels: Specifies whether the labels and ticks should
alternate. Default is True. When False tick labels will be on the left and botttom, and variable labels will be on the top and right.
- plotting.scatter_plot(aname, bname, where=None, trend=None, fname=None, output_dir='', quality='medium', alpha=0.6)¶
Creates a scatter plot with the specified parameters
- args:
aname: variable on x-axis
bname: variable on y-axis
- kwds:
- alpha:
amount of transparency applied
- trend :
None: no model fitting
‘linear’: f(x) = a + b*x
‘exponential’: f(x) = a * x**b
‘logarithmic’: f(x) = a * log(x) + b
‘polynomial’: f(x) = a * x**2 + b*x + c
‘power’: f(x) = a * x**b