epsproc.basicPlotters module

ePSproc basic plotting functions

Some basic functions for 2D/3D plots.

19/11/19 Adding plotting routines for matrix elements & beta values, to supercede existing basic methods.

07/11/19 v1 Molecular plotter for job info.

class epsproc.basicPlotters.Arrow3D(xs, ys, zs, *args, **kwargs)[source]

Bases: matplotlib.patches.FancyArrowPatch

Define Arrow3D plotting class

Code verbatim from StackOverflow post https://stackoverflow.com/a/22867877 Thanks to CT Zhu, https://stackoverflow.com/users/2487184/ct-zhu

draw(renderer)[source]

Draw the Patch to the given renderer.

epsproc.basicPlotters.BLMplot(BLM, thres=0.01, thresType='abs', xDim='Eke', backend='xr')[source]

Plotting routines for BLM values from Xarray. Plot line or surface plot, with various backends available.

Parameters:
  • BLM (Xarray) – Input data for plotting, dims assumed to be as per ePSproc.util.BLMdimList()
  • thres (float, optional, default 1e-2) – Value used for thresholding results, only values > thres will be included in the plot. Either abs or relative (%) value, according to thresType setting.
  • thresType (str, optional, default = 'abs') – Set to ‘abs’ or ‘pc’ for absolute threshold, or relative value (%age of max value in dataset)
  • xDim (str, optional, default = 'Eke') – Dimension to use for x-axis, also used for thresholding. Default plots (Eke, BLM) surfaces with subplots for (Euler). Change to ‘Euler’ to plot (Euler, BLM) with (Eke) subplots.
  • backend (str, optional, default = 'xr') – Plotter to use. Default is ‘xr’ for Xarray internal plotting. May be switched according to plot type in future…
epsproc.basicPlotters.lmPlot(data, pType='a', thres=0.01, thresType='abs', SFflag=True, logFlag=False, eulerGroup=True, selDims=None, sumDims=None, plotDims=('l', 'm', 'mu', 'Cont', 'Targ', 'Total', 'it', 'Type'), xDim='Eke', backend='sns', cmap=None, figsize=None, verbose=False)[source]

Plotting routine for ePS matrix elements & BLMs.

First pass - based on new codes + util functions from sphPlot.py, and matE sorting codes.

Parameters:
  • data (Xarray, data to plot.) – Should work for any Xarray, but optimised for dataTypes: - matE, matrix elements - BLM paramters - ADMs
  • pType (char, optional, default 'a' (abs values)) – Set (data) type to plot. See plotTypeSelector().
  • thres (float, optional, default 1e-2) – Value used for thresholding results, only values > thres will be included in the plot. Either abs or relative (%) value, according to thresType setting.
  • thresType (str, optional, default = 'abs') – Set to ‘abs’ or ‘pc’ for absolute threshold, or relative value (%age of max value in dataset)
  • SFflag (bool, optional, default = True) – For dataType = matE: Multiply by E-dependent scale factor. For dataType = BLM: Multiply by cross-section (XS) (I.e. if False, normalised BLMs are plotted, with B00 = 1)
  • logFlag (bool, optional, default = False) – Plot values on log10 scale.
  • eulerGroup (bool, optional, default = True) – Group Euler angles by set and use labels (currenly a bit flakey…)
  • selDims (dict, optional, default = {'Type':'L'}) – Dimensions to select from input Xarray.
  • sumDims (tuple, optional, default = None) – Dimensions to sum over from the input Xarray.
  • plotDims (tuple, optional, default = ('l','m','mu','Cont','Targ','Total','it','Type')) – Dimensions to stack for plotting, also controls order of stacking (hence sorting and plotting). TO DO: auto generation for different dataType, also based on selDims and sumDims selections.
  • xDim (str, optional, default = 'Eke') – Dimension to use for x-axis, also used for thresholding. Default plots (Eke, LM) surfaces.
  • backend (str, optional, default = 'sns') – Plotter to use. Default is ‘sns’ for Seaborn clustermap plot. Set to ‘xr’ for Xarray internal plotting (not all passed args will be used in this case). May be switched according to plot type in future…
  • cmap (str, optional, default = None) – Cmap option to pass to sns clustermap plot.
  • figsize (tuple, optional, default None) – Tuple for Seaborn figure size (ratio), e.g. figsize = (15,5). Useful for setting a long axis explicitly in cases with large dimensional disparity. Default results in a square (ish) aspect.
  • verbose (bool, optional, default False) – Print debug info.
Returns:

  • daPlot (Xarray) – Data subset as plotted.
  • legendList (list) – Labels & colour maps
  • g (figure object)

Notes

  • Improved dim handling, maybe use epsproc.util.matEdimList() (and related functions) to avoid hard-coding multiple cases here.
  • Improved handling of sets of polarization geometries (angles).

Examples

(See https://github.com/phockett/ePSproc/blob/master/epsproc/tests/ePSproc_demo_matE_plotting_Nov2019.ipynb)

epsproc.basicPlotters.molPlot(molInfo)[source]

Basic 3D scatter plot from molInfo data.

epsproc.basicPlotters.symListGen(data)[source]