serpentTools.plot.plot

serpentTools.plot.plot(xdata, plotData, ax=None, labels=None, yerr=None, **kwargs)

Shortcut plot for plotting series of labeled data onto a plot

If plotData is an array, it is assumed that each column represents one set of data to be plotted against xdata. The same assumption is made for yerr if given.

Parameters
  • xdata (numpy.array or iterable) – Points along the x axis to plot

  • plotData (numpy.array or iterable) – Data to be plotted

  • ax (matplotlib.axes.Axes, optional) – Ax on which to plot the data. If not provided, create a new plot

  • labels (None or iterable) – Labels to apply to each line drawn. This can be used to identify which bin is plotted as what line.

  • yerr (None or numpy.array or iterable) – Absolute error for each data point in plotData

  • kwargs (dict, optional) – Addition keyword arguments to pass to matplotlib.pyplot.plot() or matplotlib.pyplot.errorbar()

Returns

Ax on which the data was plotted.

Return type

matplotlib.axes.Axes

Raises

IndexError – If yerr is not None and does not match the shape of plotData