epsproc.plot.hvPlotters module

ePSproc plotting functions with Holoviews + Bokeh.

Aim: simple plotters for different datatypes, interactive in Jupyter Notebook + HTML formats.

13/01/21 Added
  • env check

  • setPlotDefaults() (from tmo-dev/PEMtk codes)

  • curvePlot() for general multi-dim Holomap curve plots.

15/07/20 Debugged, still pretty basic but running. 05/07/20 v1 in development.



  • Plotting style mapping & options. Currently having HV issues here.

  • Currently set only for XC datatypes from single dataSet, will want to enable stacking etc. here.

  • Errorbar or spread plots, currently having issues getting these working for multidim data.

epsproc.plot.hvPlotters.XCplot(dataXS, lineDashList={'L': 'dashed', 'M': 'solid', 'V': 'dashed'}, kdims='Eke', tString=None)[source]

Plot XC data using Holoviews.

Currently optional stuff hard-coded here, will produce plots [sigma, beta] showing all data. Rather crude, needs some more style mapping.

  • dataXS (Xarray) – Xarray dataarray containing XC data in standard format.

  • lineDashList (dict, optional, default = {'L': 'dashed', 'M': 'solid', 'V': 'dashed'}) – Set line types for calculation gauge.

  • kdims (str, optional, default = 'Eke') – Set x-axis dimension.

  • tString (str, optional, default = None) – Set



Return type

hv object


>>> plotObj, _,_ = XCplot(dataXS[0])
>>> plotObj


  • Should add some limit finding params here, to skip/fix cases for out-of-range XS or betas (e.g. null XS cases).

epsproc.plot.hvPlotters.curvePlot(dataXR, kdims=None, returnPlot=True, renderPlot=True, **kwargs)[source]

Basic routine for curve/Holomap plot from Xarray dataset.

Currently assumes all plot type selection & cleaning done in calling function.

11/01/22: basic version from recent OCS work plus TMO-dev & PEMtk codes.


Basic conversion for XS data from Xarray to Holoviews.

This will drop stacked Sym dims, and sum of Total to reduce - may not be appropriate in all cases?

epsproc.plot.hvPlotters.setPlotDefaults(fSize=[800, 400], imgSize=500, resetMpl=False, resetSns=False)[source]

Basic plot defaults

epsproc.plot.hvPlotters.setPlotters(hvBackend='bokeh', width=500, height=None, useSeaborn=True, snsStyle='darkgrid', **kwargs)[source]

Set some plot options - Seaborn style + HV defaults.

May have some issues with scope here - TBC. Should just run on function import?

Update: now moved to module import.

  • hvBackend (str or list of strs, optional, default = 'bokeh') – Backend(s) for holoviews to load. Can call bokeh, matplotlib or plotly

  • width (int, optional, default = 500) – Setting for plot width, in pixels.

  • useSeaborn (bool, optional, default = True) – Use Seaborn and styles?

  • snsStyle (str, optional, default = "darkgrid") – If using Seaborn styles, use snsStyle. See https://seaborn.pydata.org/tutorial/aesthetics.html

  • **kwargs (optional) – Passed to setPlotDefaults().