Plotting

Relevant module: edelweissfe.utils.plotter

class edelweissfe.utils.plotter.Plotter(journal, plotConfigurations, exportJobs)[source]

The unified plotter, which can be accessed and used by all outputmanagers.

Parameters
  • journal (Journal) – The journal instance for logging.

  • plotConfigurations (list[dict]) – The list of dictionaries configuring individual plots.

  • exportJobs (list[dict]) – The list of jobs to export plots at the end of a simulations.

Methods

configurePlotter()

Set global options of the plotter.

exportFigure(fileName, figureID[, width, ...])

Export a figure.

exportPlots()

Export all plots according to the export job definitions.

finalize()

Finalize and export plots.

getAx([figureID, axSpec])

Get or create a figure with axes if it doesn't exist yet.

getFig([figureID])

Get or create a figure doesn't exist yet.

plotXYData(x, y[, figureID, axSpec, plotOptions])

Plots a single curve.

show()

Show the plots!

configurePlotter()[source]

Set global options of the plotter.

exportFigure(fileName, figureID, width=469.47, scale=1.0, heightRatio=False, png=False)[source]

Export a figure.

Parameters
  • fileName (str) – The filename.

  • figureID (int) – The matplotlib figure ID.

  • width (float) – The width in pt.

  • scale (float) – Scale the figure.

  • heightRatio. – Set the height ratio or take golden mean if False.

  • png (bool) – Also export a .png figure.

  • heightRatio (float) –

exportPlots()[source]

Export all plots according to the export job definitions.

finalize()[source]

Finalize and export plots.

getAx(figureID=0, axSpec=111)[source]

Get or create a figure with axes if it doesn’t exist yet.

Parameters
  • figureID (int) – The matplotlib figure ID.

  • axSpec (int) – The matplotlib axis specification.

Returns

The matplotlib Axes instance.

Return type

matplotlib.axes.Axes

getFig(figureID=0)[source]

Get or create a figure doesn’t exist yet.

Parameters

figureID (int) – The matplotlib figure ID.

Returns

The matplotlib Figure instance.

Return type

matplotlib.figure.Figure

plotXYData(x, y, figureID=1, axSpec=111, plotOptions=None)[source]

Plots a single curve.

Parameters
  • x (ndarray) – The x data.

  • y (ndarray) – The y data.

  • figureID (int) – The matplotlib figure ID.

  • axSpec (int) – The matpotlib axes.

  • plotOptions (dict) – A dictionary with additional plot options in matplotlib format.

show()[source]

Show the plots!

Options ``*configurePlots``:

Option

Description

figure

The figure to be configured

xLimits

Specify x axis limits

yLimits

Specify y axis limits

xLabel

Specify x axis label

yLabel

Specify y axis label

flipX

Flip x axis

flipY

Flip y axis

aspect

Set aspect

grid

Switch grid

Options ``*exportPlots``:

Option

Description

figure

The figure to be exported

fileName

The export file name

width

Width of the figure

heightRatio

Ratio of height/width

png

Set true to export .png additionally

scale

Scale the figure