get_ratio_plot
- sherpa.ui.get_ratio_plot(id: IdType | None = None, recalc=True)
Return the data used by plot_ratio.
- Parameters:
id (int, str, or None, optional) – The data set. If not given then the default identifier is used, as returned by
get_default_id.recalc (bool, optional) – If
Falsethen the results from the last call toplot_ratio(orget_ratio_plot) are returned, otherwise the data is re-generated.
- Returns:
ratio_data
- Return type:
a
sherpa.plot.RatioPlotinstance- Raises:
sherpa.utils.err.IdentifierErr – If the data set does not exist or a source expression has not been set.
See also
get_chisqr_plotReturn the data used by plot_chisqr.
get_delchi_plotReturn the data used by plot_delchi.
get_resid_plotReturn the data used by plot_resid.
plot_ratioPlot the ratio of data to model for a data set.
Examples
Return the ratio of the data to the model for the default data set:
>>> rplot = get_ratio_plot() >>> np.min(rplot.y) 0.6320905073750186 >>> np.max(rplot.y) 1.5170172177000447
Display the contents of the ratio plot for data set 2:
>>> print(get_ratio_plot(2))
Overplot the ratio plot from the ‘core’ data set on the ‘jet’ data set:
>>> r1 = get_ratio_plot('jet') >>> r2 = get_ratio_plot('core') >>> r1.plot() >>> r2.overplot()