About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: March 2009

URL: http://cxc.harvard.edu/sherpa4.1/plot_data.py.html
AHELP for Sherpa 4.1

plot_data

Context: py.sherpa

Synopsis

Plot the dataset

Syntax

plot_data( [id], [replot=False, overplot=False] )

Description

The plot_data command plots the data values for a given dataset.

Argument Default Description
id 1 (can be changed, see "ahelp get_default_id") the id of the dataset to plot
replot False should previously-calculated arrays be used to create the plot?
overplot False If True then add the data to the current plot, otherwise erase the frame and create a new plot.

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 any existing plots in the window or if the window is cleared before the plot is drawn.

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 plot can be read - and changed - using the get_data_plot_prefs() command. See

unix% ahelp get_data_plot

and the examples below for more information.

Example 1

sherpa> plot_data()
sherpa> log_scale(XY_AXIS)
sherpa> print_window("data")

Plot the data in the default dataset. The ChIPS command log_scale() is used to change the scaling of the axes to logarithmic and the print_window() command is used to create a postscript version of the plot called "data.ps".

Example 2

sherpa> get_data_plot_prefs()["xlog"] = True
sherpa> get_data_plot_prefs()["ylog"] = True
sherpa> plot_data()

The plot preferences for data plots is changed to use a logarithmic scale for both X and Y axes. Any new plots created by plot_data() will therefore be drawn with both axes logged.

Example 3

sherpa> plot_data()
sherpa> plot_data("src", overplot=True)
sherpa> set_curve(["symbol.color", "green"]);

Plots the default dataset and then overplots the data from the "src" dataset. The second dataset is changed, using ChIPS commands, to green symbols.

Bugs

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

Last modified: March 2009



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.