postpic.plotting package

The plot subpackage should provide an interface to various plot backends.

postpic.plotting.use(plotcls)[source]

Submodules

postpic.plotting.plotter_matplotlib module

This package provides the MatplotlibPlotter Class.

This Class can be used to plot Field Objects using the matplotlib interface.

class postpic.plotting.plotter_matplotlib.MatplotlibPlotter(reader, outdir='./', autosave=False, project=None, ext='png', size_inches=9, 7, dpi=160, facecolor=1, 1, 1, 0.01, transparent=False)[source]

Bases: object

Provides Methods to modify figures and axes objects for convenient plotting. It also autogenerates savenames and annotates the plot if a reader is given. A reader can be a dumpreader or a simulationreder.

class LinearSegmentedColormap(name, segmentdata, N=256, gamma=1.0)

Bases: matplotlib.colors.Colormap

Colormap objects based on lookup tables using linear segments.

The lookup table is generated using linear interpolation for each primary color, with the 0-1 domain divided into any number of segments.

static from_list(name, colors, N=256, gamma=1.0)

Create a LinearSegmentedColormap from a list of colors.

Parameters
  • name (str) – The name of the colormap.

  • colors (array-like of colors or array-like of (value, color)) – If only colors are given, they are equidistantly mapped from the range \([0, 1]\); i.e. 0 maps to colors[0] and 1 maps to colors[-1]. If (value, color) pairs are given, the mapping is from value to color. This can be used to divide the range unevenly.

  • N (int) – The number of rgb quantization levels.

  • gamma (float) –

reversed(name=None)

Return a reversed instance of the Colormap.

Parameters

name (str, optional) – The name for the reversed colormap. If it’s None the name will be the name of the parent colormap + “_r”.

Returns

The reversed colormap.

Return type

LinearSegmentedColormap

set_gamma(gamma)

Set a new gamma value and regenerate color map.

static addField1d(ax, field, log10plot=True, xlim=None, ylim=None, scaletight=None)[source]
static addField2d(figax, field, log10plot=True, interpolation='none', contourlevels=array([], dtype=float64), saveandclose=True, xlim=None, ylim=None, clim=None, savecsv=False, lineoutx=False, lineouty=False, **kwargs)[source]
static addFields1d(ax, *fields, **kwargs)[source]
static addaxislabels(ax, field)[source]
static annotate(figorax, title=None, time=None, step=None, project=None, dump=None, infostring=None, infos=None)[source]
static annotate_fromfield(figorax, field)[source]
static annotate_fromreader(figorax, reader)[source]
axesformatterx = <matplotlib.ticker.ScalarFormatter object>
axesformattery = <matplotlib.ticker.ScalarFormatter object>
efieldcdict = {'blue': ((0, 1, 1), (0.5, 1, 1), (1, 0, 0)), 'green': ((0, 0, 0), (0.5, 1, 1), (1, 0, 0)), 'red': ((0, 0, 0), (0.5, 1, 1), (1.0, 1, 1))}
lastsavename()[source]

returns the last savenme. If there wasnt a last a new savename is created.

matplotlib = <module 'matplotlib' from '/usr/lib/python3.8/site-packages/matplotlib/__init__.py'>
plotField(field, autoreduce=True, maxlen=6000, name=None, **kwargs)[source]

This is the main method, that should be used for plotting.

plotField2d(field, name=None, **kwargs)[source]
plotFields(*fields, **kwargs)[source]
plotFields1d(*fields, **kwargs)[source]
plotallderived(dumpreader)[source]

plots all fields dumped.

property project
savefig(fig, key)[source]
savename(key, ext=None)[source]
static settext_ax(ax, title=None, ur=None, ur2=None, ul=None, ul2=None, center=None)[source]
static settext_fig(fig, title=None, ur=None, ur2=None, ul=None, ul2=None, center=None)[source]
symmap = <matplotlib.colors.LinearSegmentedColormap object>
static symmetricclim(ax)[source]

symmetrize the clim around 0.

static symmetricclimaximage(aximage)[source]

symmetrize the clim around 0.