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

Skip the navigation links
Last modified: 20 May 2008
Hardcopy (PDF): A4 | Letter

How do I plot a curve from a file?


The make_figure (S-Lang or Python help) and add_curve (S-Lang or Python help) commands can plot data from a file (in both FITS binary and ASCII formats).

  1. Two columns: A set of (x,y) points.

    # Python
      make_figure("file.lis[cols x,y]")
      add_curve("file.lis[cols x,y]")
    
    % S-Lang
      make_figure("file.lis[cols x,y]");
      add_curve("file.lis[cols x,y]");
    

    This will plot up columns x and y from the file file.lis.

  2. Three columns: A set of (x,y) points with symmetric errors on y.

    # Python
      make_figure("file.lis[cols x,y,dy]")
      add_curve("file.lis[cols x,y,dy]")
    
    % S-Lang
      make_figure("file.lis[cols x,y,dy]");
      add_curve("file.lis[cols x,y,dy]");
    

    This will plot up columns x and y from the file file.lis, and draw symmetric error bars whose length is given by the dy column. The dy values should be >= 0.

  3. Four columns: A set of (x,y) points with asymmetric errors on y.

    # Python
      make_figure("file.lis[cols x,y,dylo,dyhi]")
      add_curve("file.lis[cols x,y,dylo,dyhi]")
    
    % S-Lang
      make_figure("file.lis[cols x,y,dylo,dyhi]");
      add_curve("file.lis[cols x,y,dylo,dyhi]");
    

    This will plot up columns x and y from the file file.lis, and draw asymmetric error bars whose lengths are given by the dylo and dyhi columns (which should both be >= 0).



Hardcopy (PDF): A4 | Letter
Last modified: 20 May 2008


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.