sherpa.ui.get_source_plot(id=None, recalc=True)

Return the data used to create the source plot.

  • id (int or str, optional) – The data set that provides the data. If not given then the default identifier is used, as returned by get_default_id.

  • recalc (bool, optional) – If False then the results from the last call to plot_source (or get_source_plot) are returned, otherwise the data is re-generated.


An object representing the data used to create the plot by plot_source. The return value depends on the data set (e.g. 1D binned or un-binned).

Return type


See also


Return the data used to create the model plot.


Plot the model for a data set.


Plot the source expression for a data set.


Retrieve the source plot information for the default data set and then display it:

>>> splot = get_source_plot()
>>> print(splot)

Return the plot data for data set 2, and then use it to create a plot:

>>> s2 = get_source_plot(2)
>>> s2.plot()

Display the two source plots for the ‘jet’ and ‘core’ datasets on the same plot:

>>> splot1 = get_source_plot(id='jet')
>>> splot2 = get_source_plot(id='core')
>>> splot1.plot()
>>> splot2.overplot()