get_rmf_plot

sherpa.astro.ui.get_rmf_plot(id: IdType | None = None, resp_id: IdType | None = None, recalc: bool = True, copy: bool = True)

Return the data used by plot_rmf.

Changed in version 4.19.0: The plot object is now copied by default. To get the previous behaviour set the copy attribute to False.

Added in version 4.16.0.

Parameters:
idint, str, or None, optional

The data set with a RMF. If not given then the default identifier is used, as returned by get_default_id.

resp_idint, str, or None, optional

Which RMF to use in the case that multiple RMFs are associated with a data set. The default is None, which means the first one.

recalcbool, optional

If False then the results from the last call to plot_rmf (or get_rmf_plot) are returned, otherwise the data is re-generated.

copybool, optional

Is the plot object copied before being returned? If so then the plot attributes will not be changed by multiple calls to this routine.

Returns:
rmf_plota sherpa.astro.plot.RMFPlot instance
Raises:
sherpa.utils.err.ArgumentErr

If the data set does not contain PHA data.

See also

plot

Create one or more plot types.

plot_rmf

Plot the RMF associated with a data set.

Examples

Return the RMF plot data for the default data set:

>>> rplot = get_rmf_plot()

Return the RMF data for the second response of the data set labelled ‘histate’, and then plot it:

>>> rplot = get_rmf_plot('histate', 2)
>>> rplot.plot()