xyzpy.plot.plotter_bokeh#

Module Contents#

Classes#

Functions#

_init_bokeh_nb()

Cache this so it doesn't happen over and over again.

bshow(figs[, nb, interactive])

bokeh_multi_plot(fn)

Decorate a plotting function to plot a grid of values.

ilineplot(ds, x, y[, z, y_err, x_err])

From ds plot lines of y as a function of x, optionally for

auto_ilineplot(x, y_z, **lineplot_opts)

Auto version of ilineplot() that accepts array arguments

iscatter(ds, x, y[, z, y_err, x_err])

From ds plot a scatter of y against x, optionally for

auto_iscatter(x, y_z, **iscatter_opts)

Auto version of iscatter() that accepts array arguments

iheatmap(ds, x, y, z, **kwargs)

From ds plot variable z as a function of x and y using

auto_iheatmap(x, **iheatmap_opts)

Auto version of iheatmap() that accepts array arguments

Attributes#

xyzpy.plot.plotter_bokeh._init_bokeh_nb()[source]#

Cache this so it doesn’t happen over and over again.

xyzpy.plot.plotter_bokeh.bshow(figs, nb=True, interactive=False, **kwargs)[source]#
class xyzpy.plot.plotter_bokeh.PlotterBokeh(ds, x, y, z=None, **kwargs)[source]#

Bases: xyzpy.plot.core.Plotter

prepare_axes()[source]#

Make the bokeh plot figure and set options.

set_axes_labels()[source]#

Set the labels on the axes.

set_axes_range()[source]#

Set the plot ranges of the axes, and the panning limits.

set_spans()[source]#

Set custom horizontal and verical line spans.

set_gridlines()[source]#

Set whether to use gridlines or not.

set_tick_marks()[source]#

Set custom locations for the tick marks.

set_sources_heatmap()[source]#
set_sources()[source]#

Set the source dictionaries to be used by the plotter functions. This is seperate to allow interactive updates of the data only.

plot_legend(legend_items=None)[source]#

Add a legend to the plot.

set_mappable()[source]#
plot_colorbar()[source]#
set_tools()[source]#

Set which tools appear for the plot.

update()[source]#
show(**kwargs)[source]#

Show the produced figure.

prepare_plot()[source]#
xyzpy.plot.plotter_bokeh.bokeh_multi_plot(fn)[source]#

Decorate a plotting function to plot a grid of values.

class xyzpy.plot.plotter_bokeh.ILinePlot(ds, x, y, z=None, y_err=None, x_err=None, **kwargs)[source]#

Bases: PlotterBokeh, xyzpy.plot.core.AbstractLinePlot

plot_lines()[source]#

Plot the data and a corresponding legend.

__call__()[source]#
xyzpy.plot.plotter_bokeh.ilineplot(ds, x, y, z=None, y_err=None, x_err=None, **kwargs)[source]#

From ds plot lines of y as a function of x, optionally for varying z. Interactive,

Parameters:
  • ds (xarray.Dataset) – Dataset to plot from.

  • x (str) – Dimension to plot along the x-axis.

  • y (str or tuple[str]) – Variable(s) to plot along the y-axis. If tuple, plot each of the variables - instead of z.

  • z (str, optional) – Dimension to plot into the page.

  • y_err (str, optional) – Variable to plot as y-error.

  • x_err (str, optional) – Variable to plot as x-error.

  • row (str, optional) – Dimension to vary over as a function of rows.

  • col (str, optional) – Dimension to vary over as a function of columns.

  • plot_opts – See xyzpy.plot.core.PLOTTER_DEFAULTS.

class xyzpy.plot.plotter_bokeh.AutoILinePlot(x, y_z, **lineplot_opts)[source]#

Bases: ILinePlot

Interactive raw data multi-line plot.

xyzpy.plot.plotter_bokeh.auto_ilineplot(x, y_z, **lineplot_opts)[source]#

Auto version of ilineplot() that accepts array arguments by converting them to a Dataset first.

class xyzpy.plot.plotter_bokeh.IScatter(ds, x, y, z=None, **kwargs)[source]#

Bases: PlotterBokeh, xyzpy.plot.core.AbstractScatter

plot_scatter()[source]#
__call__()[source]#
xyzpy.plot.plotter_bokeh.iscatter(ds, x, y, z=None, y_err=None, x_err=None, **kwargs)[source]#

From ds plot a scatter of y against x, optionally for varying z. Interactive.

Parameters:
  • ds (xarray.Dataset) – Dataset to plot from.

  • x (str) – Quantity to plot along the x-axis.

  • y (str or tuple[str]) – Quantity(s) to plot along the y-axis. If tuple, plot each of the variables - instead of z.

  • z (str, optional) – Dimension to plot into the page.

  • y_err (str, optional) – Variable to plot as y-error.

  • x_err (str, optional) – Variable to plot as x-error.

  • row (str, optional) – Dimension to vary over as a function of rows.

  • col (str, optional) – Dimension to vary over as a function of columns.

  • plot_opts – See xyzpy.plot.core.PLOTTER_DEFAULTS.

class xyzpy.plot.plotter_bokeh.AutoIScatter(x, y_z, **iscatter_opts)[source]#

Bases: IScatter

xyzpy.plot.plotter_bokeh.auto_iscatter(x, y_z, **iscatter_opts)[source]#

Auto version of iscatter() that accepts array arguments by converting them to a Dataset first.

xyzpy.plot.plotter_bokeh._HEATMAP_ALT_DEFAULTS = (('legend', False), ('colorbar', True), ('colormap', 'inferno'), ('gridlines', False),...#
class xyzpy.plot.plotter_bokeh.IHeatMap(ds, x, y, z, **kwargs)[source]#

Bases: PlotterBokeh, xyzpy.plot.core.AbstractHeatMap

plot_heatmap()[source]#
__call__()[source]#
xyzpy.plot.plotter_bokeh.iheatmap(ds, x, y, z, **kwargs)[source]#

From ds plot variable z as a function of x and y using a 2D heatmap. Interactive,

Parameters:
  • ds (xarray.Dataset) – Dataset to plot from.

  • x (str) – Dimension to plot along the x-axis.

  • y (str) – Dimension to plot along the y-axis.

  • z (str, optional) – Variable to plot as colormap.

  • row (str, optional) – Dimension to vary over as a function of rows.

  • col (str, optional) – Dimension to vary over as a function of columns.

  • plot_opts – See xyzpy.plot.core.PLOTTER_DEFAULTS.

class xyzpy.plot.plotter_bokeh.AutoIHeatMap(x, **iheatmap_opts)[source]#

Bases: IHeatMap

xyzpy.plot.plotter_bokeh.auto_iheatmap(x, **iheatmap_opts)[source]#

Auto version of iheatmap() that accepts array arguments by converting them to a Dataset first.