BokehBackend

class sherpa.plot.bokeh_backend.BokehBackend(*args, **kwargs)[source] [edit on github]

Bases: BasicBackend

Sherpa plotting backend for the bokeh package.

bokeh is a plotting library that generates a json representation of a plot, which is then rendered in a browser (either in a jupyter notebook or in a new tab for traditional python scripts). For the relatively simple cases supporting standard sherpa plotting commands, the json representation can be saved and displayed in a browser without the need for a running python kernel. Thus, plots like this can be embedded into webpages or as “interactive figures” in e.g. AAS journals.

Attributes:
name

An easy-to-read string name

Methods

as_html(func)

Create HTML representation of a plot

as_html_plot_or_contour(data[, summary, ...])

Create HTML representation of a plot

clear_window()

Provide empty plot window

colorlist(n)

Generate the list of n colors for use in multi-line plots.

contour(x0, x1, y, *[, levels, title, ...])

Draw 2D contour data.

get_image_defaults()

Currently, there are no configurable settings

get_latex_for_string(txt)

Convert LaTeX formula

get_split_plot_defaults()

histo(xlo, xhi, y, *[, yerr, title, xlabel, ...])

Draw histogram data.

hline(y, *[, xmin, xmax, linecolor, ...])

Draw a horizontal line

image(x0, x1, y, *[, aspect, title, xlabel, ...])

Draw 2D image data.

initialize_plot(dataset, ids)

Create the plot window or figure for the given dataset.

plot(x, y, *[, yerr, xerr, title, xlabel, ...])

Draw x, y data.

select_plot(dataset, ids)

Select the plot window or figure for the given dataset.

set_jointplot(row, col, nrows, ncols[, ...])

Move to the plot, creating them if necessary.

set_subplot(row, col, nrows, ncols[, ...])

Select a plot space in a grid of plots or create new grid

set_title(title)

Change the display title.

setup_axes(overplot, clearwindow)

Return the axes object, creating it if necessary.

setup_plot(axes[, title, xlabel, ylabel, ...])

Basic plot setup.

vline(x, *[, ymin, ymax, linecolor, ...])

Draw a vertical line

as_html_cdf

as_html_contour

as_html_contour1d

as_html_contour2d

as_html_data

as_html_datacontour

as_html_fit

as_html_fitcontour

as_html_histogram

as_html_image

as_html_lr

as_html_model

as_html_modelcontour

as_html_pdf

as_html_plot

get_cdf_plot_defaults

get_component_histo_defaults

get_component_plot_defaults

get_confid_contour_defaults

get_confid_plot_defaults

get_confid_point_defaults

get_contour_defaults

get_data_contour_defaults

get_data_plot_defaults

get_fit_contour_defaults

get_fit_plot_defaults

get_histo_defaults

get_html

get_model_contour_defaults

get_model_histo_defaults

get_model_plot_defaults

get_plot_defaults

get_point_defaults

get_ratio_contour_defaults

get_ratio_plot_defaults

get_resid_contour_defaults

get_resid_histo_defaults

get_resid_plot_defaults

get_rmf_plot_defaults

get_scatter_plot_defaults

Notes

The sherpa plotting API is procedural and most of the commands act on the “current plot” or “current figure”. This fits in very well with the matplotlib.pyplot model, but requires some extra work for object-oriented plotting packages.

bokeh is such an object-oriented package, which, by itself, does not keep a plotting state. Usually, bokeh commands act on an axis object that is passed in as a parameter. Sherpa, on the other hand, does not keep track of those objects, it expects the plotting package to know what the “current” plot is.

We solve this problem with attributes in the BokehBackend class:

  • current_fig: the current figure

  • current_axis: the current axis. This is a reference to one of the panels in the current figure.

We follow a similar approach to default to cycling through colors like matplotlib does. The bokeh package does not have a similar mechanism, so we wrap bokeh.plotting.figure to add an additional attribute _color_cycle that is an itertools.cycle object cycling through the colors in the palette defined in the palette attribute of the BokehBackend class.

Attributes Summary

name

An easy-to-read string name

palette

translate_colors

translate_dict

Dict of keyword arguments that need to be translated for this backend.

Methods Summary

as_html(func)

Create HTML representation of a plot

as_html_cdf(data[, summary, plotting_func])

as_html_contour(data[, summary, plotting_func])

as_html_contour1d(data[, summary, plotting_func])

as_html_contour2d(data[, summary, plotting_func])

as_html_data(data[, summary, plotting_func])

as_html_datacontour(data[, summary, ...])

as_html_fit(data[, summary, plotting_func])

as_html_fitcontour(data[, summary, ...])

as_html_histogram(data[, summary, plotting_func])

as_html_image(data[, summary, plotting_func])

as_html_lr(data[, summary, plotting_func])

as_html_model(data[, summary, plotting_func])

as_html_modelcontour(data[, summary, ...])

as_html_pdf(data[, summary, plotting_func])

as_html_plot(data[, summary, plotting_func])

as_html_plot_or_contour(data[, summary, ...])

Create HTML representation of a plot

clear_window()

Provide empty plot window

colorlist(n)

Generate the list of n colors for use in multi-line plots.

contour(x0, x1, y, *[, levels, title, ...])

Draw 2D contour data.

get_cdf_plot_defaults()

get_component_histo_defaults()

get_component_plot_defaults()

get_confid_contour_defaults()

get_confid_plot_defaults()

get_confid_point_defaults()

get_contour_defaults()

get_data_contour_defaults()

get_data_plot_defaults()

get_fit_contour_defaults()

get_fit_plot_defaults()

get_histo_defaults()

get_html(attr)

get_image_defaults()

Currently, there are no configurable settings

get_latex_for_string(txt)

Convert LaTeX formula

get_model_contour_defaults()

get_model_histo_defaults()

get_model_plot_defaults()

get_plot_defaults()

get_point_defaults()

get_ratio_contour_defaults()

get_ratio_plot_defaults()

get_resid_contour_defaults()

get_resid_histo_defaults()

get_resid_plot_defaults()

get_rmf_plot_defaults()

get_scatter_plot_defaults()

get_split_plot_defaults()

histo(xlo, xhi, y, *[, yerr, title, xlabel, ...])

Draw histogram data.

hline(y, *[, xmin, xmax, linecolor, ...])

Draw a horizontal line

image(x0, x1, y, *[, aspect, title, xlabel, ...])

Draw 2D image data.

initialize_plot(dataset, ids)

Create the plot window or figure for the given dataset.

plot(x, y, *[, yerr, xerr, title, xlabel, ...])

Draw x, y data.

select_plot(dataset, ids)

Select the plot window or figure for the given dataset.

set_jointplot(row, col, nrows, ncols[, ...])

Move to the plot, creating them if necessary.

set_subplot(row, col, nrows, ncols[, ...])

Select a plot space in a grid of plots or create new grid

set_title(title)

Change the display title.

setup_axes(overplot, clearwindow)

Return the axes object, creating it if necessary.

setup_plot(axes[, title, xlabel, ylabel, ...])

Basic plot setup.

vline(x, *[, ymin, ymax, linecolor, ...])

Draw a vertical line

Attributes Documentation

name

An easy-to-read string name

palette = ('#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf')
translate_colors = {'b': 'blue', 'c': 'cyan', 'g': 'green', 'k': 'black', 'm': 'magenta', 'r': 'red', 'w': 'white', 'y': 'yellow'}
translate_dict = {'alpha': {None: 1.0}, 'aspect': {'auto': None, 'equal': 1.0}, 'capsize': {None: 0}, 'color': {'b': 'blue', 'c': 'cyan', 'g': 'green', 'k': 'black', 'm': 'magenta', 'r': 'red', 'w': 'white', 'y': 'yellow'}, 'colors': {None: 'black'}, 'drawstyle': {'steps': 'before', 'steps-mid': 'center', 'steps-post': 'after', 'steps-pre': 'before'}, 'ecolor': {'b': 'blue', 'c': 'cyan', 'g': 'green', 'k': 'black', 'm': 'magenta', 'r': 'red', 'w': 'white', 'y': 'yellow'}, 'linecolor': {'b': 'blue', 'c': 'cyan', 'g': 'green', 'k': 'black', 'm': 'magenta', 'r': 'red', 'w': 'white', 'y': 'yellow'}, 'linestyle': {'-': 'solid', '--': 'dashed', '-.': 'dotdash', ':': 'dotted', 'None': 'noline', 'dash': 'dashed', 'dot': 'dotted', 'longdash': 'dashed', 'solid': 'solid', None: 'solid'}, 'linestyles': {None: 'solid'}, 'linewidth': {None: 1}, 'linewidths': {None: 1}, 'marker': {'+': 'cross', '.': 'circle', 'o': 'circle', 's': 'square', None: ''}, 'markerfacecolor': {'b': 'blue', 'c': 'cyan', 'g': 'green', 'k': 'black', 'm': 'magenta', 'r': 'red', 'w': 'white', 'y': 'yellow'}, 'markersize': {None: 5}}

Dict of keyword arguments that need to be translated for this backend.

The keys in this dict are keyword arguments (e.g. 'markerfacecolor') and the values are one of the following: - A dict where the keys are the backend-independent values and the values are the values expressed for this backend. For values not listed in the dict, no translation is done. - A callable. The callable translation function is called with any argument given and allows the backend arbitrary translations. It should, at the very least, accept all backend independent values for this parameter without error.

In particular, sherpa uses None to mean “the default”, while in bokeh None often means “don’t show this”, so None values are translated to a sensible default value (e.g. line thickness of 1)

Methods Documentation

as_html(func)[source] [edit on github]

Create HTML representation of a plot

Parameters:
funcfunction

The function, which takes no arguments, which will create the plot. It creates and returns the Figure.

Returns:
plotstr or None

The HTML, or None if there was an error (e.g. prepare not called).

as_html_cdf(data, summary=None, *, plotting_func='plot') [edit on github]
as_html_contour(data, summary=None, *, plotting_func='contour') [edit on github]
as_html_contour1d(data, summary=None, *, plotting_func='plot') [edit on github]
as_html_contour2d(data, summary=None, *, plotting_func='contour') [edit on github]
as_html_data(data, summary=None, *, plotting_func='plot') [edit on github]
as_html_datacontour(data, summary=None, *, plotting_func='contour') [edit on github]
as_html_fit(data, summary=None, *, plotting_func='plot') [edit on github]
as_html_fitcontour(data, summary=None, *, plotting_func='contour') [edit on github]
as_html_histogram(data, summary=None, *, plotting_func='plot') [edit on github]
as_html_image(data, summary=None, *, plotting_func='plot') [edit on github]
as_html_lr(data, summary=None, *, plotting_func='plot') [edit on github]
as_html_model(data, summary=None, *, plotting_func='plot') [edit on github]
as_html_modelcontour(data, summary=None, *, plotting_func='contour') [edit on github]
as_html_pdf(data, summary=None, *, plotting_func='plot') [edit on github]
as_html_plot(data, summary=None, *, plotting_func='plot') [edit on github]
as_html_plot_or_contour(data, summary=None, plotting_func='plot')[source] [edit on github]

Create HTML representation of a plot

Parameters:
dataPlot instance

The plot object to display. It has already had its prepare method called.

summarystr or None, optional

The summary of the detail. If not set then the data type name is used.

plotting_funcstr, optional

The function to call on the data object to make the plot.

Returns:
plotstr or None

The HTML, or None if there was an error (e.g. prepare not called).

clear_window()[source] [edit on github]

Provide empty plot window

Depending on the backend, this may provide a new, empty window or clear the existing, current window.

colorlist(n) [edit on github]

Generate the list of n colors for use in multi-line plots.

Generally, the color will be ordered in some way and do not repeat or do so only after a large number of colors. Different backends might generate different lists of colors.

Parameters:
nint

Number of colors requested

Returns:
colorslist

list of color specifiers

contour(x0, x1, y, *, levels=None, title=None, xlabel=None, ylabel=None, overcontour=False, clearwindow=True, xlog=False, ylog=False, alpha=None, linewidths=None, linestyles='solid', colors=None, label=None, **kwargs)[source] [edit on github]

Draw 2D contour data.

Parameters:
x0array_like

independent axis in the first dimenation (on regular grid, flattened)

x1array_like

independent axis in the second dimenation (on regular grid, flattened)

yarray_like

dependent axis (i.e. image values) (on regular grid, flattened)

levelsarray_like, default=None

Levels at which to draw the contours

titlestr, default=None

Plot title (can contain LaTeX formulas). Only used if a new plot is created.

xlabelstr, default=None

Axis label (can contain LaTeX formulas). Only used if a new plot is created.

ylabelstr, default=None

Axis label (can contain LaTeX formulas). Only used if a new plot is created.

overcontourbool, default=False

If True, the contour is added to an existing plot, if not a new plot is created.

clearwindowbool, default=True

If True the entire figure area is cleared to make space for a new plot.

xlogbool, default=False

Should the x axis be logarithmic (default: linear)? Only used if a new plot is created.

ylogbool, default=False

Should the y axis be logarithmic (default: linear)? Only used if a new plot is created.

alphafloat, default=None

Number between 0 and 1, setting the transparency.

linewidthsdefault=None
linestylesdefault=solid
colorsdefault=None
labelstr, default=None

Label this dataset for use in a legend

kwargsdict, optional

All other keyword parameters are passed to the plotting library.

get_cdf_plot_defaults() [edit on github]
get_component_histo_defaults() [edit on github]
get_component_plot_defaults() [edit on github]
get_confid_contour_defaults() [edit on github]
get_confid_plot_defaults() [edit on github]
get_confid_point_defaults() [edit on github]
get_contour_defaults() [edit on github]
get_data_contour_defaults() [edit on github]
get_data_plot_defaults() [edit on github]
get_fit_contour_defaults() [edit on github]
get_fit_plot_defaults() [edit on github]
get_histo_defaults() [edit on github]
get_html(attr) [edit on github]
get_image_defaults() [edit on github]

Currently, there are no configurable settings

get_latex_for_string(txt)[source] [edit on github]

Convert LaTeX formula

Parameters:
txtstr

The text component in LaTeX form (e.g. r’lpha^2’). It should not contain any non-LaTeX content.

Returns:
latexstr

The text modified as appropriate for a backend so that the LaTeX will be displayed properly.

get_model_contour_defaults() [edit on github]
get_model_histo_defaults() [edit on github]
get_model_plot_defaults() [edit on github]
get_plot_defaults() [edit on github]
get_point_defaults() [edit on github]
get_ratio_contour_defaults() [edit on github]
get_ratio_plot_defaults() [edit on github]
get_resid_contour_defaults() [edit on github]
get_resid_histo_defaults() [edit on github]
get_resid_plot_defaults() [edit on github]
get_rmf_plot_defaults() [edit on github]
get_scatter_plot_defaults() [edit on github]
get_split_plot_defaults() [edit on github]
histo(xlo, xhi, y, *, yerr=None, title=None, xlabel=None, ylabel=None, overplot=False, clearwindow=True, xerrorbars=False, yerrorbars=False, ecolor=None, capsize=None, xlog=False, ylog=False, linestyle='None', drawstyle='default', color=None, alpha=None, marker='None', markerfacecolor=None, markersize=None, label=None, linewidth=None, linecolor=None, **kwargs)[source] [edit on github]

Draw histogram data.

The histogram is drawn as horizontal lines connecting the start and end points of each bin, with vertical lines connecting consecutive bins. Non-consecutive bins are drawn with a (NaN, NaN) between them so no line is drawn connecting them.

Points are drawn at the middle of the bin, along with any error values.

Note that the linecolor is not used, and is only included to support old code that may have set this option (use color instead).

Parameters:
xloarray_like or scalar number

lower bin boundary values

xhiarray_like or scalar number

upper bin boundary values

yarray_like or scalar number

y values, same dimension as xlo.

yerrfloat or array_like, default=None
The errorbar sizes can be:
  • scalar: Symmetric +/- values for all data points.

  • shape(N,): Symmetric +/-values for each data point.

  • shape(2, N): Separate - and + values for each bar. First row contains the lower errors, the second row contains the upper errors.

  • None: No errorbar.

Note that all error arrays should have positive values.

titlestr, default=None

Plot title (can contain LaTeX formulas). Only used if a new plot is created.

xlabelstr, default=None

Axis label (can contain LaTeX formulas). Only used if a new plot is created.

ylabelstr, default=None

Axis label (can contain LaTeX formulas). Only used if a new plot is created.

overplotbool, default=False

If True, the plot is added to an existing plot, if not a new plot is created.

clearwindowbool, default=True

If True the entire figure area is cleared to make space for a new plot.

xerrorbarsbool, default=False

Should x error bars be shown? If this is set to True errorbars are shown, but only if the size of the errorbars is provided in the xerr parameters. The purpose of having a separate switch xerrorbars is that the prepare method of a plot can create the errors and pass them to this method, but the user can still decide to change the style of the plot and choose if error bars should be displayed.

yerrorbarsbool, default=False

Should y error bars be shown? If this is set to True errorbars are shown, but only if the size of the errorbars is provided in the yerr parameters. The purpose of having a separate switch yerrorbars is that the prepare method of a plot can create the errors and pass them to this method, but the user can still decide to change the style of the plot and choose if error bars should be displayed.

ecolorstr, default=None

Color of the error bars.

capsizefloat, default=None

Size of the cap drawn at the end of the error bars.

xlogbool, default=False

Should the x axis be logarithmic (default: linear)? Only used if a new plot is created.

ylogbool, default=False

Should the y axis be logarithmic (default: linear)? Only used if a new plot is created.

linestylestr, default=None

'noline', 'None' (as string, same as 'noline'), 'solid', 'dot', 'dash', 'dotdash', '-' (solid line), ':' (dotted), '--' (dashed), '-.' (dot-dashed), '' (empty string, no line shown), None (default - usually solid line) or any other bokeh linestyle.

drawstylestr, default=default

bokeh drawstyle

colorstr or tuple, default=None

Any bokeh color

alphafloat, default=None

Number between 0 and 1, setting the transparency.

markerstr, default=None

“None” (as a string, no marker shown), “” (empty string, no marker shown), or any bokeh marker (see bokeh documentation).

markerfacecolorstr, default=None

see color

markersizefloat, default=None

Size of a marker. The scale may also depend on the backend. None uses the backend-specific default.

labelstr, default=None

Label this dataset for use in a legend

linewidthfloat, default=None

Thickness of the line.

linecolorstr or tuple, default=None

Any bokeh color

kwargsdict, optional

All other keyword parameters are passed to the plotting library.

hline(y, *, xmin=0, xmax=1, linecolor=None, linestyle=None, linewidth=None, overplot=False, clearwindow=True, **kwargs)[source] [edit on github]

Draw a horizontal line

Parameters:
yfloat

x position of the vertical line in data units

xminfloat, default=0

Beginning of the horizontal line in axes coordinates, i.e. from 0 (left) to 1 (right).

xmaxfloat, default=1

End of the vertical line in axes coordinates, i.e. from 0 (left) to 1 (right).

linecolorstr or tuple, default=None

Any bokeh color

linestylestr, default=None

'noline', 'None' (as string, same as 'noline'), 'solid', 'dot', 'dash', 'dotdash', '-' (solid line), ':' (dotted), '--' (dashed), '-.' (dot-dashed), '' (empty string, no line shown), None (default - usually solid line) or any other bokeh linestyle.

linewidthfloat, default=None

Thickness of the line.

overplotbool, default=False

If True, the plot is added to an existing plot, if not a new plot is created.

clearwindowbool, default=True

If True the entire figure area is cleared to make space for a new plot.

kwargsdict, optional

All other keyword parameters are passed to the plotting library.

image(x0, x1, y, *, aspect=None, title=None, xlabel=None, ylabel=None, clearwindow=True, overplot=False, **kwargs)[source] [edit on github]

Draw 2D image data.

Warning

This function is experimental and is currently only used in the rish display code.

Parameters:
x0array_like

independent axis in the first dimension

x1array_like

independent axis in the second dimension

yarray_like, with shape

dependent axis (i.e. image values) in 2D with shape (len(x0), len(x1))

aspectstr or float, default=None

Aspect ratio of the plot. Strings “equal” or “auto” are accepted.

titlestr, default=None

Plot title (can contain LaTeX formulas). Only used if a new plot is created.

xlabelstr, default=None

Axis label (can contain LaTeX formulas). Only used if a new plot is created.

ylabelstr, default=None

Axis label (can contain LaTeX formulas). Only used if a new plot is created.

clearwindowbool, default=True

If True the entire figure area is cleared to make space for a new plot.

overplotbool, default=False

If True, the plot is added to an existing plot, if not a new plot is created.

kwargsdict, optional

All other keyword parameters are passed to the plotting library.

initialize_plot(dataset, ids) [edit on github]

Create the plot window or figure for the given dataset.

Warning

This function is a non-functional dummy. The documentation is provided as a template only.

Parameters:
datasetstr or int

The dataset.

idsarray_like

The identifier array from the DataStack object.

See also

select_plot
plot(x, y, *, yerr=None, xerr=None, title=None, xlabel=None, ylabel=None, overplot=False, clearwindow=True, xerrorbars=False, yerrorbars=False, ecolor=None, capsize=0, xlog=False, ylog=False, linestyle='solid', drawstyle='default', color=None, marker='None', markerfacecolor=None, markersize=1, alpha=1, label=None, linewidth=1, linecolor=None, xaxis=None, ratioline=None, **kwargs)[source] [edit on github]

Draw x, y data.

This method combines a number of different ways to draw x/y data:
  • a line connecting the points

  • scatter plot of symbols

  • errorbars

All three of them can be used together (symbols with errorbars connected by a line), but it is also possible to use only one or two of them. By default, a line is shown (linestyle='solid'), but marker and error bars are not (marker='None' and xerrorbars=False as well as yerrorbars=False).

Note that the linecolor is not used, and is only included to support old code that may have set this option (use color instead).

Parameters:
xarray_like or scalar number

x values

yarray_like or scalar number

y values, same dimension as x.

yerrfloat or array_like, default=None
The errorbar sizes can be:
  • scalar: Symmetric +/- values for all data points.

  • shape(N,): Symmetric +/-values for each data point.

  • shape(2, N): Separate - and + values for each bar. First row contains the lower errors, the second row contains the upper errors.

  • None: No errorbar.

Note that all error arrays should have positive values.

xerrfloat or array_like, default=None
The errorbar sizes can be:
  • scalar: Symmetric +/- values for all data points.

  • shape(N,): Symmetric +/-values for each data point.

  • shape(2, N): Separate - and + values for each bar. First row contains the lower errors, the second row contains the upper errors.

  • None: No errorbar.

Note that all error arrays should have positive values.

titlestr, default=None

Plot title (can contain LaTeX formulas). Only used if a new plot is created.

xlabelstr, default=None

Axis label (can contain LaTeX formulas). Only used if a new plot is created.

ylabelstr, default=None

Axis label (can contain LaTeX formulas). Only used if a new plot is created.

overplotbool, default=False

If True, the plot is added to an existing plot, if not a new plot is created.

clearwindowbool, default=True

If True the entire figure area is cleared to make space for a new plot.

xerrorbarsbool, default=False

Should x error bars be shown? If this is set to True errorbars are shown, but only if the size of the errorbars is provided in the xerr parameters. The purpose of having a separate switch xerrorbars is that the prepare method of a plot can create the errors and pass them to this method, but the user can still decide to change the style of the plot and choose if error bars should be displayed.

yerrorbarsbool, default=False

Should y error bars be shown? If this is set to True errorbars are shown, but only if the size of the errorbars is provided in the yerr parameters. The purpose of having a separate switch yerrorbars is that the prepare method of a plot can create the errors and pass them to this method, but the user can still decide to change the style of the plot and choose if error bars should be displayed.

ecolorstr, default=None

Color of the error bars.

capsizefloat, default=0

Size of the cap drawn at the end of the error bars.

xlogbool, default=False

Should the x axis be logarithmic (default: linear)? Only used if a new plot is created.

ylogbool, default=False

Should the y axis be logarithmic (default: linear)? Only used if a new plot is created.

linestylestr, default=solid

'noline', 'None' (as string, same as 'noline'), 'solid', 'dot', 'dash', 'dotdash', '-' (solid line), ':' (dotted), '--' (dashed), '-.' (dot-dashed), '' (empty string, no line shown), None (default - usually solid line) or any other bokeh linestyle.

drawstylestr, default=default

bokeh drawstyle

colorstr or tuple, default=None

Any bokeh color

markerstr, default=None

“None” (as a string, no marker shown), “” (empty string, no marker shown), or any bokeh marker (see bokeh documentation).

markerfacecolorstr, default=None

see color

markersizefloat, default=1

Size of a marker. The scale may also depend on the backend. None uses the backend-specific default.

alphafloat, default=1

Number between 0 and 1, setting the transparency.

labelstr, default=None

Label this dataset for use in a legend

linewidthfloat, default=1

Thickness of the line.

linecolorstr or tuple, default=None

Any bokeh color

xaxisdefault=None
ratiolinedefault=None
kwargsdict, optional

All other keyword parameters are passed to the plotting library.

ratioline, xaxisNone

These parameters are deprecated and not used any longer.

select_plot(dataset, ids) [edit on github]

Select the plot window or figure for the given dataset.

The plot for this dataset is assumed to have been created.

Warning

This function is a non-functional dummy. The documentation is provided as a template only.

Parameters:
datasetstr or int

The dataset.

idsarray_like

The identifier array from the DataStack object.

See also

initialize_plot
set_jointplot(row, col, nrows, ncols, create=True, top=0, ratio=2)[source] [edit on github]

Move to the plot, creating them if necessary.

Parameters:
rowint

The row number, starting from 0.

colint

The column number, starting from 0.

nrowsint

The number of rows.

ncolsint

The number of columns.

createbool, optional

If True then create the plots

topint

The row that is set to the ratio height, numbered from 0.

ratiofloat

The ratio of the height of row number top to the other rows.

set_subplot(row, col, nrows, ncols, clearaxes=True, left=None, right=None, bottom=None, top=None, wspace=0.3, hspace=0.4)[source] [edit on github]

Select a plot space in a grid of plots or create new grid

This method adds a new subplot in a grid of plots.

Parameters:
row, colint

index (starting at 0) of a subplot in a grid of plots

nrows, ncolsint

Number of rows and column in the plot grid

clearaxesbool

If True, clear entire plotting area before adding the new subplot.

set_title(title: str) None[source] [edit on github]

Change the display title.

Parameters:
titlestr

The title text to use.

setup_axes(overplot, clearwindow)[source] [edit on github]

Return the axes object, creating it if necessary.

Parameters:
overplotbool
clearwindowbool
Returns:
axis

The bokeh axes object.

setup_plot(axes, title=None, xlabel=None, ylabel=None, xlog=False, ylog=False)[source] [edit on github]

Basic plot setup.

Parameters:
axes

The plot axes (output of setup_axes).

vline(x, *, ymin=0, ymax=1, linecolor=None, linestyle=None, linewidth=None, overplot=False, clearwindow=True, **kwargs)[source] [edit on github]

Draw a vertical line

Parameters:
xfloat

x position of the vertical line in data units

yminfloat, default=0

Beginning of the vertical line in axes coordinates, i.e. from 0 (bottom) to 1 (top).

ymaxfloat, default=1

End of the vertical line in axes coordinates, i.e. from 0 (bottom) to 1 (top).

linecolorstr or tuple, default=None

Any bokeh color

linestylestr, default=None

'noline', 'None' (as string, same as 'noline'), 'solid', 'dot', 'dash', 'dotdash', '-' (solid line), ':' (dotted), '--' (dashed), '-.' (dot-dashed), '' (empty string, no line shown), None (default - usually solid line) or any other bokeh linestyle.

linewidthfloat, default=None

Thickness of the line.

overplotbool, default=False

If True, the plot is added to an existing plot, if not a new plot is created.

clearwindowbool, default=True

If True the entire figure area is cleared to make space for a new plot.

kwargsdict, optional

All other keyword parameters are passed to the plotting library.