ebisim.plotting module

All the plotting logic of ebisim is collected in this module. The functions can be called manually by the user, but are primarily desinged to be called internally by ebisim, thefore the API may lack convenience in some places.

ebisim.plotting.decorate_axes(ax, grid=True, legend=False, label_lines=True, tight_layout=True, **kwargs)[source]

This function exists to have a common routine for setting certain figure properties, it is called by all other plotting routines and takes over the majority of the visual polishing.

Parameters
  • ax (matplotlib.Axes) – The axes to be modifed.

  • grid (bool, optional) – Whether or not to lay a grid over the plot, by default True.

  • legend (bool, optional) – Whether or not to put a legend next to the plot, by default False.

  • label_lines (bool, optional) – Whether or not to put labels along the lines in the plot, by default True.

  • tight_layout (bool, optional) – Whether or not to apply matplotlibs tight layout on the parentfigure of ax, by default True.

  • **kwargs – Are directly applied as axes properties, e.g. xlabel, xscale, title, etc.

ebisim.plotting.plot_combined_xs(element, fwhm, **kwargs)[source]

Creates a figure showing the electron ionisation, radiative recombination and, dielectronic recombination cross sections of the provided element.

Parameters
  • element (ebisim.elements.Element or str or int) – An instance of the Element class, or an identifier for the element, i.e. either its name, symbol or proton number.

  • fwhm (float) – <eV> Energy spread to apply for the resonance smearing, expressed in terms of full width at half maximum.

  • **kwargs – Remaining keyword arguments are handed down to ebisim.plotting.decorate_axes, cf. documentation thereof. If no arguments are provided, reasonable default values are injected.

Returns

matplotlib.Figure – Figure handle of the generated plot.

ebisim.plotting.plot_drxs(element, fwhm, **kwargs)[source]

Creates a figure showing the dielectronic recombination cross sections of the provided element.

Parameters
  • element (ebisim.elements.Element or str or int) – An instance of the Element class, or an identifier for the element, i.e. either its name, symbol or proton number.

  • fwhm (float) – <eV> Energy spread to apply for the resonance smearing, expressed in terms of full width at half maximum.

  • **kwargs – ‘fig’ is intercepted and can be used to plot on top of an existing figure. ‘ls’ is intercepted and can be used to set the linestyle for plotting. Remaining keyword arguments are handed down to ebisim.plotting.decorate_axes, cf. documentation thereof. If no arguments are provided, reasonable default values are injected.

Returns

matplotlib.Figure – Figure handle of the generated plot.

ebisim.plotting.plot_eixs(element, **kwargs)[source]

Creates a figure showing the electron ionisation cross sections of the provided element.

Parameters
  • element (ebisim.elements.Element or str or int) – An instance of the Element class, or an identifier for the element, i.e. either its name, symbol or proton number.

  • **kwargs – ‘fig’ is intercepted and can be used to plot on top of an existing figure. ‘ls’ is intercepted and can be used to set the linestyle for plotting. Remaining keyword arguments are handed down to ebisim.plotting.decorate_axes, cf. documentation thereof. If no arguments are provided, reasonable default values are injected.

Returns

matplotlib.Figure – Figure handle of the generated plot.

ebisim.plotting.plot_energy_scan(energies, abundance, cs=None, **kwargs)[source]

Produces a plot of the charge state abundance for different energies at a given time.

Parameters
  • energies (numpy.array) – <eV> The evaluated energies.

  • abundance (numpy.array) – The abundance of each charge state (rows) for each energy (columns).

  • cs (list of int or None, optional) – If None, all charge states are plotted. By supplying a list of int it is possible to filter the charge states that should be plotted. By default None.

  • **kwargs – Keyword arguments are handed down to ebisim.plotting.decorate_axes, cf. documentation thereof. If no arguments are provided, reasonable default values are injected.

Returns

matplotlib.Figure – Figure handle of the generated plot.

ebisim.plotting.plot_energy_time_scan(energies, times, abundance, **kwargs)[source]

Provides information about the abundance of a single charge states at all simulated times and energies.

Parameters
  • energies (numpy.array) – <eV> The evaluated energies.

  • times (numpy.array) – <s> The evaluated timesteps.

  • abundance (numpy.array) – Abundance of charge state ‘cs’ at given times (rows) and energies (columns).

  • **kwargs – Keyword arguments are handed down to ebisim.plotting.decorate_axes, cf. documentation thereof. If no arguments are provided, reasonable default values are injected.

Returns

matplotlib.Figure – Figure handle of the generated plot.

ebisim.plotting.plot_generic_evolution(t, y, plot_total=False, ax=None, cs=None, **kwargs)[source]

Plots the evolution of a quantity with time

Parameters
  • t (numpy.array) – <s> Values for the time steps.

  • y (numpy.array) – Values of the evoloving quantity to plot as a function of time. Has to be a 2D numpy array where the rows correspond to the different charge states and the columns correspond to the individual timesteps.

  • plot_total (bool, optional) – Indicate whether a black dashed line indicating the total accross all charge states should also be plotted, by default False.

  • ax (matplotlib.Axes, optional) – Provide if you want to add this plot to existing Axes, by default None.

  • cs (list[int], optional) – Specify which charge states should be plotted, plot all if omitted.

  • **kwargs – Keyword arguments are handed down to ebisim.plotting.decorate_axes, cf. documentation thereof. If no arguments are provided, reasonable default values are injected.

Returns

matplotlib.Figure – Figure handle of the generated plot.

ebisim.plotting.plot_radial_distribution(r, dens, phi=None, r_e=None, ax=None, ax2=None, **kwargs)[source]

Plots the radial ion distribution, can also plot radial potential and electron beam radius.

Parameters
  • r (numpy.ndarray) – [description]

  • dens (numpy.ndarray) – Array of densities, shaped like ‘y’ in plot_generic_evolution.

  • phi (numpy.ndarray, optional) – The radial potential, if supplied will be plotted on second y-axis, by default None.

  • r_e (numpy.ndarray, optional) – Electron beam radius, if provided will be marked as vertical likne, by default None.

  • ax (numpy.ndarray, optional) – Axes on which to plot the densities, by default None.

  • ax2 (numpy.ndarray, optional) – Axes on which to plot the radial potential, by default None.

Returns

  • ax (matplotlib.Axes) – As above.

  • ax2 (matplotlib.Axes) – As above.

ebisim.plotting.plot_rrxs(element, **kwargs)[source]

Creates a figure showing the radiative recombination cross sections of the provided element.

Parameters
  • element (ebisim.elements.Element or str or int) – An instance of the Element class, or an identifier for the element, i.e. either its name, symbol or proton number.

  • **kwargs – ‘fig’ is intercepted and can be used to plot on top of an existing figure. ‘ls’ is intercepted and can be used to set the linestyle for plotting. Remaining keyword arguments are handed down to ebisim.plotting.decorate_axes, cf. documentation thereof. If no arguments are provided, reasonable default values are injected.

Returns

matplotlib.Figure – Figure handle of the generated plot.

ebisim.plotting.COLORMAP = <matplotlib.colors.ListedColormap object>

The default colormap used to grade line plots, assigning another colormap to this object will result in an alternative color gradient for line plots