Last modified: December 2024

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/get_fit_plot.html
Jump to: · Examples · PARAMETERS · Bugs


AHELP for CIAO 4.17 Sherpa

get_fit_plot

Context: plotting

Synopsis

Return the data used to create the fit plot.

Syntax

get_fit_plot(id=None, recalc=True)

Examples

Example 1

Create the data needed to create the "fit plot" for the default data set and display it:

>>> fplot = get_fit_plot()
>>> print(fplot)

Example 2

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

>>> f2 = get_fit_plot(2)
>>> f2.plot()

Example 3

The fit plot consists of a combination of a data plot and a model plot, which are captured in the `dataplot` and `modelplot` attributes 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()

PARAMETERS

The parameters for this function are:

Parameter Type information Definition
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 False then the results from the last call to `plot_fit` (or `get_fit_plot` ) are returned, otherwise the data is re-generated.

Return value

The return value from this function is:

data -- An object representing the data used to create the plot by `plot_fit` . It contains the data from `get_data_plot` and `get_model_plot` in the dataplot and modelplot attributes.


Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.