Plotting

Functions related to plotting.

xarpes.plotting.get_ax_fig_plt(ax=None, **kwargs)[source]

Helper function used in plot functions supporting an optional Axes argument.

If ax is None, we build the matplotlib figure and create the Axes. Else we return the current active figure.

Parameters:
axobject

Axes object. Defaults to None.

**kwargs

Keyword arguments are passed to plt.figure if ax is not None.

Returns:
axobject

Axes object.

figureobject

matplotlib figure.

pltobject

matplotlib.pyplot module.

xarpes.plotting.add_fig_kwargs(func)[source]

Decorator that adds keyword arguments for functions returning matplotlib figures.

The function should return either a matplotlib figure or None to signal some sort of error/unexpected event.