MultiPlot

class sherpa.plot.MultiPlot[source] [edit on github]

Bases: object

Combine multiple line-style plots.

Allow multiple line-style plots - so those plot classes that use the plot method to display - to be drawn in the same area. Each plot is added with the add method.

Changed in version 4.18.0: A number of attributes are now taken from the first plot, once it has been added.

Added in version 4.16.1.

Attributes Summary

plots

title

Methods Summary

add(plot)

Add the plot to the list of data to plot.

plot([overplot, clearwindow])

Plot the data.

Attributes Documentation

plots: list[Plot | HistogramPlot]
title

Methods Documentation

add(plot: Plot | HistogramPlot) None[source] [edit on github]

Add the plot to the list of data to plot.

The plot object is stored, so it is up to the user to decide whether it should be copied or not.

Parameters:

plot (instance) – The plot or histogram object to add. It must have a plot method.

plot(overplot: bool = False, clearwindow: bool = True, **kwargs) None[source] [edit on github]

Plot the data.

Changed in version 4.17.0: The keyword arguments can now be set per plot by sending in a sequence of values.

Parameters:
  • overplot (bool, optional) – If True then add the data to an existing plot, otherwise create a new plot.

  • clearwindow (bool, optional) – Should the existing plot area be cleared before creating this new plot (e.g. for multi-panel plots)?

  • **kwargs – These values are passed on to the plot backend, and must match the names of the keys of the object’s plot_prefs dictionary. If the value is a scalar then the value is sent to each plot, but if it’s a sequence (not a string) then it must match the number of plots and the values are used sequentially.