plot_rmf
- sherpa.astro.ui.plot_rmf(id: IdType | None = None, resp_id: IdType | None = None, replot=False, overplot=False, clearwindow=True, **kwargs) None
Plot the RMF associated with a data set.
Display the energy redistribution from the RMF component of a PHA data set. This plot selects a few specific energies and generates a plot with several histograms that show the energy redistribution for those specific energies.
Added in version 4.16.0.
- Parameters:
id (int, 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_id (int, 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.replot (bool, optional) – Set to
True
to use the values calculated by the last call toplot_data
. The default isFalse
.overplot (bool, optional) – If
True
then add the data to an existing plot, otherwise create a new plot. The default isFalse
.clearwindow (bool, optional) – Should the existing plot area be cleared before creating this new plot (e.g. for multi-panel plots)?
- Raises:
sherpa.utils.err.ArgumentErr – If the data set does not contain PHA data.
See also
get_rmf_plot
Return the data used by plot_rmf.
Examples
Plot the RMF for the default data set:
>>> plot_rmf()
Plot the RMF from data set 1 and overplot the RMF from data set 2:
>>> plot_rmf(1) >>> plot_rmf(2, overplot=True)
Plot the RMFs labelled “rmf1” and “rmf2” for the “src” data set:
>>> plot_rmf("src", "rmf1") >>> plot_rmf("src", "rmf2", overplot=True)
The following example requires that the Matplotlib backend is selected, since this determines what extra keywords
plot_rmf
accepts. The RMFs from the default and data set 2 are drawn together, but the second curve is drawn with a dashed line.>>> plot_rmf(ylog=True) >>> plot_rmf(2, overplot=True, linestyle='dashed')