|
|
|
|
SynopsisPlot the fit, fit plus delta chi, or fit plus residuals Syntaxplot_fit([id], [replot=False, overplot=False]) plot_fit_delchi([id], [replot=False, clearwindow=True]) plot_fit_resid([id], [replot=False, clearwindow=True]) DescriptionThe plot_fit command plots the fit. The plot_fit_delchi and plot_fit_resid commands plot the fit along with the delta chi (residuals divided by uncertainties) and residuals (measured counts minus predicted counts), respectively.
The plot is displayed in a ChIPS plotting window. If there is no plotting window open, one is created. If a plotting window exists, the "overplot" parameter value determines whether the new plot is overlaid on the existing plot in the window or if the window is cleared before the plot is drawn. The "clearwindow" value determines whether a new ChIPS frame should be created for the plots; setting the value to False allows for multiple plot_fit_delchi or plot_fit_resid output to be displayed side-by-side, as shown in the examples. ChIPS commands may be used within Sherpa to modify plot characteristics and create hardcopies; refer to the ChIPS website for information. The default values for the plots can be read - and changed - using the get_data_plot_prefs() and get_model_plot_prefs() commands. See unix% ahelp get_data_plot unix% ahelp get_model_plot and the examples below for more information. Example 1sherpa> plot_fit() sherpa> log_scale(XY_AXIS) Plot the fit for the default dataset and then change both axes to use logarithmic scaling. Example 2sherpa> get_data_plot_prefs()["xlog"] = True sherpa> get_data_plot_prefs()["ylog"] = True sherpa> plot_fit() Here the plot preferences for data plots are chanegd to use logarithmic scaling for both axes. Any new plot showing data - such as plot_fit() - will therefore use logged axes by default. Example 3
sherpa> plot_fit("src", overplot=True)Plot the fit for the "src" dataset, overlaying on any existing plots. Example 4
sherpa> set_preference("frame.transparency", "true")
sherpa> plot_fit_delchi(1)
sherpa> reposition_frame(0.0,0.5,1.0,1.0)
sherpa> plot_fit_delchi(2, clearwindow=False)
sherpa> reposition_frame(0.0,0.0,1.0,0.5)
sherpa> save_state("fits.state")Normally, Sherpa plots clear the contents of the current ChIPS window before creating the new plot. For commands that create only a single plot - such as plot_fit() - the overplot option can be used to overlay data onto an existing plot. There is no overplot support for commands like plot_fit_delchi() and plot_fit_resid(), which create two separate plots; instead it is possible to create the plots in separate ChIPS frames and then re-size the frames so as to show multiple datasets in the same window. In this example we create two plots for dataset 1, then re-size the frame they are in so that they occupy the top-half of the window. The second plot_fit_delchi call creates a new frame, which by default fills the whole window, but does not delete the existing frame because the clearwindow argument has been set to False. The second frame is then re-sized so that it fills the bottom-half of the window. The save_state() call creates a binary file (i.e. not human readable) that can be loaded into a new ChIPS session - using load_state() - so as to re-create the window. This can be useful to allow further editing of the plot for publication without having to re-create the fit in Sherpa. The set_preference call is used to allow overlapping ChIPS frames - as used in this example - to show contents below them. If it had not been made then the second plot_fit_delchi() call would have appeared to delete the first frame as the new frame completely covered the old frame. CHANGES IN CIAO 4.1.2plot_fit_delchi and plot_fit_resid have a new "clearwindow" option, which allows multiples of those plots to be displayed in the same ChIPS frame. Refer to the examples for information on how to use "clearwindow". BugsSee the bugs pages on the Sherpa website for an up-to-date listing of known bugs. See Also
|
![]() |
The Chandra X-Ray
Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA. Email: cxcweb@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2004. All rights reserved. |