henchman.plotting.show

henchman.plotting.show(plot, png=False, static=False, hover=True, width=None, height=None, title=None, x_axis=None, y_axis=None, x_range=None, y_range=None, colors=None, fig=False)[source]

Format and show a bokeh plot. This is a wrapper around bokeh show which can add common plot attributes like height, axis labels and whether or not you would like the output as a png. This function also runs the bokeh function output_notebook() to start.

You can get a full list of options by function with show_template().

Parameters:
  • plot (function) – The plot to show.
  • static (bool) – If True, show a static bokeh plot.
  • hover (bool) – If True, show the hovertool. Default is True.
  • width (int, optional) – Plot width.
  • height (int, optional) – Plot height.
  • title (str, optional) – The title for the plot.
  • x_axis (str, optional) – The x_axis label.
  • y_axis (str, optional) – The y_axis label.
  • x_range (tuple[int, int], optional) – A min and max x value to plot.
  • y_range (tuple[int, int], optional) – A min and max y value to plot.
  • colors (list[str], optional) – A list of colors to use for the plot.
  • png (bool) – If True, return a png of the plot. Default is False
  • fig (bool, advanced) – If True, return a bokeh figure instead of showing the plot. Only use if you want to manipulate the bokeh figure directly.

Example

>>> import henchman.plotting as hplot
>>> hplot.show_template()
show(plot,
     static=False,
     png=False,
     hover=True,
     width=None,
     height=None,
     title='Temporary title',
     x_axis='my xaxis name',
     y_axis='my yaxis name',
     x_range=(0, 10) or None,
     y_range=(0, 10) or None,
     colors=None)
>>> hplot.show(plot, width=500, title='My Plot Title')
>>> hplot.show(plot, png=True, static=True)