datura package
Submodules
datura.draw
functions to produce a line plot
- datura.draw.bar(*args, bar_width=None, **kwargs)[source]
Returns .svg text and saves a .svg file containing a bar chart of the data in lists xs and ys.
Parameters
- xslist of lists, optional
Abscissas of the centers of the bars to plot (each list corresponds to a different collection of bars) if not specified, bars are centered on 0, 1, … N
- yslist of lists
Ordinates of the bars to plot (each list corresponds to a different collection)
- filenamestring, optional
Name of the file to save. Default is ‘plot.svg’
- x_labelstring, optional
Label for x axis
- y_labelstring, optional
Label for y axis
- titlestring, optional
Title of figure
- colorslist, optional
List containing svg colors for each line
- x_tickslist, optional
locations of ticks on the x-axis. If list with one element, will result in no x-axis being displayed (but axis will be extended if necessary to include that value) If None an automatically generated axis is displayed
- y_tickslist, optional
locations of ticks on the y-axis. If list with one element, will result in no y-axis being displayed (but axis will be extended if necessary to include that value) If None an automatically generated axis is displayed
- x_ticks_textlist, optional
text to replace x_tick labels (requires x_ticks)
- y_ticks_textlist, optional
text to replace y_tick labels (requires y_ticks)
- interactive_modebool, optional
if True, display inline (jupyter notebooks) or in new browser tab
Returns
full_figure : raw svg string
Notes
Tries to infer correct behavior when input is unexpected.
- datura.draw.base_plot(xs, ys, yus=None, yls=None, filename='plot.svg', x_label=None, y_label=None, title=None, colors=None, fill_colors=None, fill_opacities=None, line_widths='1', points_radii=None, labels=None, label_nudges=None, x_ticks=None, y_ticks=None, x_ticks_text=None, y_ticks_text=None, interactive_mode=True, dark_mode=False)[source]
- datura.draw.error_plot(*args, **kwargs)[source]
Returns .svg text and saves a .svg file containing a line plot of the data in lists ys and xs with error patches between lists yus and yls.
Parameters
- xslist of lists
Abscissas of the lines to plot (each list corresponds to a different line)
- yslist of lists
Ordinates of the lines to plot (each list corresponds to a different line)
- yuslist of lists, optional
Ordinates of the upper bounds of the error patches to plot (each list corresponds to a different line)
- ylslist of lists, optional
Ordinates of the lower bounds of the error patches to plot (each list corresponds to a different line)
- y_errors: list of lists, optional
Values to be added and subtracted from ys to create error patches (each list corresponds to a different line)
- filenamestring, optional
Name of the file to save. Default is ‘plot.svg’
- x_labelstring, optional
Label for x axis
- y_labelstring, optional
Label for y axis
- titlestring, optional
Title of figure
- colorslist, optional
List containing svg colors for each line
- fill_colorslist, optional
List containing svg colors for each patch (between yus and yls)
- fill_opacitieslist, optional
List containing numbers between 0 and 1 for each patch (between yus and yls)
- line_widthslist, optional
List containing width for each line
- points_radiilist, optional
List containing size of circles at each data point
- labelslist of strings, optional
Labels corresponding to each line
- label_nudgeslist of ints, optional
distances to move labels (intended to manually avoid overlaps)
- x_tickslist, optional
locations of ticks on the x-axis. If list with one element, will result in no x-axis being displayed (but axis will be extended if necessary to include that value) If None an automatically generated axis is displayed
- y_tickslist, optional
locations of ticks on the y-axis. If list with one element, will result in no y-axis being displayed (but axis will be extended if necessary to include that value) If None an automatically generated axis is displayed
- x_ticks_textlist, optional
text to replace x_tick labels (requires x_ticks)
- y_ticks_textlist, optional
text to replace y_tick labels (requires y_ticks)
- interactive_modebool, optional
if True, display inline (jupyter notebooks) or in new browser tab
Returns
full_figure : raw svg string
Notes
Tries to infer correct behavior when input is unexpected.
- datura.draw.hist(data, bin_edges=10, **kwargs)[source]
Returns .svg text and saves a .svg file containing a histogram of the data in list of lists data.
Parameters
- datalist of lists
raw values to be binned into histogram counts (each list corresponds to a different histogram)
- bin_edgesint or list of lists
if int, that number of equally spaced bins are created between the minimum value in the data and the maximum value in data if lists, each list is used as bins for each list in the input data
- filenamestring, optional
Name of the file to save. Default is ‘plot.svg’
- x_labelstring, optional
Label for x axis
- y_labelstring, optional
Label for y axis
- titlestring, optional
Title of figure
- colorslist, optional
List containing svg colors for each histogram
- fill_colorslist, optional
List containing svg fill colors for each patch
- fill_opacitieslist, optional
List containing numbers between 0 and 1 for each fill
- line_widthslist, optional
List containing width for each histogram
- labelslist of strings, optional
Labels corresponding to each line
- label_nudgeslist of ints, optional
distances to move labels (intended to manually avoid overlaps)
- x_tickslist, optional
locations of ticks on the x-axis. If list with one element, will result in no x-axis being displayed (but axis will be extended if necessary to include that value) If None an automatically generated axis is displayed
- y_tickslist, optional
locations of ticks on the y-axis. If list with one element, will result in no y-axis being displayed (but axis will be extended if necessary to include that value) If None an automatically generated axis is displayed
- x_ticks_textlist, optional
text to replace x_tick labels (requires x_ticks)
- y_ticks_textlist, optional
text to replace y_tick labels (requires y_ticks)
- interactive_modebool, optional
if True, display inline (jupyter notebooks) or in new browser tab
full_figure : raw svg string
Tries to infer correct behavior when input is unexpected.
- datura.draw.plot(*args, **kwargs)[source]
Returns .svg text and saves a .svg file containing a line plot of the data in lists xs and ys.
Parameters
- xslist of lists
Abscissas of the lines to plot (each list corresponds to a different line)
- yslist of lists
Ordinates of the lines to plot (each list corresponds to a different line)
- filenamestring, optional
Name of the file to save. Default is ‘plot.svg’
- x_labelstring, optional
Label for x axis
- y_labelstring, optional
Label for y axis
- titlestring, optional
Title of figure
- colorslist, optional
List containing svg colors for each line
- line_widthslist, optional
List containing width for each line
- points_radiilist, optional
List containing size of circles at each data point
- labelslist of strings, optional
Labels corresponding to each line
- label_nudgeslist of ints, optional
distances to move labels (intended to manually avoid overlaps)
- x_tickslist, optional
locations of ticks on the x-axis. If list with one element, will result in no x-axis being displayed (but axis will be extended if necessary to include that value) If None an automatically generated axis is displayed
- y_tickslist, optional
locations of ticks on the y-axis. If list with one element, will result in no y-axis being displayed (but axis will be extended if necessary to include that value) If None an automatically generated axis is displayed
- x_ticks_textlist, optional
text to replace x_tick labels (requires x_ticks)
- y_ticks_textlist, optional
text to replace y_tick labels (requires y_ticks)
- interactive_modebool, optional
if True, display inline (jupyter notebooks) or in new browser tab
Returns
full_figure : raw svg string
Notes
Tries to infer correct behavior when input is unexpected.
- datura.draw.scatter(*args, **kwargs)[source]
Returns .svg text and saves a .svg file containing a scatter plot of the data in lists xs and ys.
Parameters
- xslist of lists
Abscissas of the lines to plot (each list corresponds to a different line)
- yslist of lists
Ordinates of the lines to plot (each list corresponds to a different line)
- filenamestring, optional
Name of the file to save. Default is ‘plot.svg’
- x_labelstring, optional
Label for x axis
- y_labelstring, optional
Label for y axis
- titlestring, optional
Title of figure
- colorslist, optional
List containing svg colors for each line
- points_radiilist, optional
List containing size of circles at each data point
- labelslist of strings, optional
Labels corresponding to each line
- label_nudgeslist of ints, optional
distances to move labels (intended to manually avoid overlaps)
- x_tickslist, optional
locations of ticks on the x-axis. If list with one element, will result in no x-axis being displayed (but axis will be extended if necessary to include that value) If None an automatically generated axis is displayed
- y_tickslist, optional
locations of ticks on the y-axis. If list with one element, will result in no y-axis being displayed (but axis will be extended if necessary to include that value) If None an automatically generated axis is displayed
- x_ticks_textlist, optional
text to replace x_tick labels (requires x_ticks)
- y_ticks_textlist, optional
text to replace y_tick labels (requires y_ticks)
- interactive_modebool, optional
if True, display inline (jupyter notebooks) or in new browser tab
Returns
full_figure : raw svg string
Notes
Tries to infer correct behavior when input is unexpected.