get_fit_plot
- sherpa.astro.ui.get_fit_plot(id: IdType | None = None, recalc: bool = True)
Return the data used to create the fit plot.
- Parameters:
id (int, str, or None, 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
Falsethen the results from the last call toplot_fit(orget_fit_plot) are returned, otherwise the data is re-generated.
- Returns:
data – An object representing the data used to create the plot by
plot_fit. It contains the data fromget_data_plotandget_model_plotin thedataplotandmodelplotattributes.- Return type:
a
sherpa.plot.FitPlotinstance
See also
get_data_plot_prefsReturn the preferences for plot_data.
get_model_plot_prefsReturn the preferences for plot_model.
get_default_idReturn the default data set identifier.
plot_dataPlot the data values.
plot_modelPlot the model for a data set.
Examples
Create the data needed to create the “fit plot” for the default data set and display it:
>>> fplot = get_fit_plot() >>> print(fplot)
Return the plot data for data set 2, and then use it to create a plot:
>>> f2 = get_fit_plot(2) >>> f2.plot()
The fit plot consists of a combination of a data plot and a model plot, which are captured in the
dataplotandmodelplotattributes of the return value. These can be used to display the plots individually, such as:>>> f2.dataplot.plot() >>> f2.modelplot.plot()
or, to combine the two:
>>> f2.dataplot.plot() >>> f2.modelplot.overplot()