xyzpy.plot.plotter_bokeh ======================== .. py:module:: xyzpy.plot.plotter_bokeh Attributes ---------- .. autoapisummary:: xyzpy.plot.plotter_bokeh._HEATMAP_ALT_DEFAULTS Classes ------- .. autoapisummary:: xyzpy.plot.plotter_bokeh.PlotterBokeh xyzpy.plot.plotter_bokeh.ILinePlot xyzpy.plot.plotter_bokeh.AutoILinePlot xyzpy.plot.plotter_bokeh.IScatter xyzpy.plot.plotter_bokeh.AutoIScatter xyzpy.plot.plotter_bokeh.IHeatMap xyzpy.plot.plotter_bokeh.AutoIHeatMap Functions --------- .. autoapisummary:: xyzpy.plot.plotter_bokeh._init_bokeh_nb xyzpy.plot.plotter_bokeh.bshow xyzpy.plot.plotter_bokeh.bokeh_multi_plot xyzpy.plot.plotter_bokeh.ilineplot xyzpy.plot.plotter_bokeh.auto_ilineplot xyzpy.plot.plotter_bokeh.iscatter xyzpy.plot.plotter_bokeh.auto_iscatter xyzpy.plot.plotter_bokeh.iheatmap xyzpy.plot.plotter_bokeh.auto_iheatmap Module Contents --------------- .. py:function:: _init_bokeh_nb() Cache this so it doesn't happen over and over again. .. py:function:: bshow(figs, nb=True, interactive=False, **kwargs) .. py:class:: PlotterBokeh(ds, x, y, z=None, **kwargs) Bases: :py:obj:`xyzpy.plot.core.Plotter` .. py:attribute:: _interactive .. py:method:: prepare_axes() Make the bokeh plot figure and set options. .. py:method:: set_axes_labels() Set the labels on the axes. .. py:method:: set_axes_range() Set the plot ranges of the axes, and the panning limits. .. py:method:: set_spans() Set custom horizontal and verical line spans. .. py:method:: set_gridlines() Set whether to use gridlines or not. .. py:method:: set_tick_marks() Set custom locations for the tick marks. .. py:method:: set_sources_heatmap() .. py:method:: set_sources() Set the source dictionaries to be used by the plotter functions. This is seperate to allow interactive updates of the data only. .. py:method:: plot_legend(legend_items=None) Add a legend to the plot. .. py:method:: set_mappable() .. py:method:: plot_colorbar() .. py:method:: set_tools() Set which tools appear for the plot. .. py:method:: update() .. py:method:: show(**kwargs) Show the produced figure. .. py:method:: prepare_plot() .. py:function:: bokeh_multi_plot(fn) Decorate a plotting function to plot a grid of values. .. py:class:: ILinePlot(ds, x, y, z=None, y_err=None, x_err=None, **kwargs) Bases: :py:obj:`PlotterBokeh`, :py:obj:`xyzpy.plot.core.AbstractLinePlot` .. py:method:: plot_lines() Plot the data and a corresponding legend. .. py:method:: __call__() .. py:function:: ilineplot(ds, x, y, z=None, y_err=None, x_err=None, **kwargs) From ``ds`` plot lines of ``y`` as a function of ``x``, optionally for varying ``z``. Interactive, :param ds: Dataset to plot from. :type ds: xarray.Dataset :param x: Dimension to plot along the x-axis. :type x: str :param y: Variable(s) to plot along the y-axis. If tuple, plot each of the variables - instead of ``z``. :type y: str or tuple[str] :param z: Dimension to plot into the page. :type z: str, optional :param y_err: Variable to plot as y-error. :type y_err: str, optional :param x_err: Variable to plot as x-error. :type x_err: str, optional :param row: Dimension to vary over as a function of rows. :type row: str, optional :param col: Dimension to vary over as a function of columns. :type col: str, optional :param plot_opts: See ``xyzpy.plot.core.PLOTTER_DEFAULTS``. .. py:class:: AutoILinePlot(x, y_z, **lineplot_opts) Bases: :py:obj:`ILinePlot` Interactive raw data multi-line plot. .. py:function:: auto_ilineplot(x, y_z, **lineplot_opts) Auto version of :func:`~xyzpy.ilineplot` that accepts array arguments by converting them to a ``Dataset`` first. .. py:class:: IScatter(ds, x, y, z=None, **kwargs) Bases: :py:obj:`PlotterBokeh`, :py:obj:`xyzpy.plot.core.AbstractScatter` .. py:method:: plot_scatter() .. py:method:: __call__() .. py:function:: iscatter(ds, x, y, z=None, y_err=None, x_err=None, **kwargs) From ``ds`` plot a scatter of ``y`` against ``x``, optionally for varying ``z``. Interactive. :param ds: Dataset to plot from. :type ds: xarray.Dataset :param x: Quantity to plot along the x-axis. :type x: str :param y: Quantity(s) to plot along the y-axis. If tuple, plot each of the variables - instead of ``z``. :type y: str or tuple[str] :param z: Dimension to plot into the page. :type z: str, optional :param y_err: Variable to plot as y-error. :type y_err: str, optional :param x_err: Variable to plot as x-error. :type x_err: str, optional :param row: Dimension to vary over as a function of rows. :type row: str, optional :param col: Dimension to vary over as a function of columns. :type col: str, optional :param plot_opts: See ``xyzpy.plot.core.PLOTTER_DEFAULTS``. .. py:class:: AutoIScatter(x, y_z, **iscatter_opts) Bases: :py:obj:`IScatter` .. py:function:: auto_iscatter(x, y_z, **iscatter_opts) Auto version of :func:`~xyzpy.iscatter` that accepts array arguments by converting them to a ``Dataset`` first. .. py:data:: _HEATMAP_ALT_DEFAULTS :value: (('legend', False), ('colorbar', True), ('colormap', 'inferno'), ('gridlines', False),... .. py:class:: IHeatMap(ds, x, y, z, **kwargs) Bases: :py:obj:`PlotterBokeh`, :py:obj:`xyzpy.plot.core.AbstractHeatMap` .. py:method:: plot_heatmap() .. py:method:: __call__() .. py:function:: iheatmap(ds, x, y, z, **kwargs) From ``ds`` plot variable ``z`` as a function of ``x`` and ``y`` using a 2D heatmap. Interactive, :param ds: Dataset to plot from. :type ds: xarray.Dataset :param x: Dimension to plot along the x-axis. :type x: str :param y: Dimension to plot along the y-axis. :type y: str :param z: Variable to plot as colormap. :type z: str, optional :param row: Dimension to vary over as a function of rows. :type row: str, optional :param col: Dimension to vary over as a function of columns. :type col: str, optional :param plot_opts: See ``xyzpy.plot.core.PLOTTER_DEFAULTS``. .. py:class:: AutoIHeatMap(x, **iheatmap_opts) Bases: :py:obj:`IHeatMap` .. py:function:: auto_iheatmap(x, **iheatmap_opts) Auto version of :func:`~xyzpy.iheatmap` that accepts array arguments by converting them to a ``Dataset`` first.