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 create a hardcopy version of my plot?


The print_window() (S-Lang, Python help) routine creates a hardcopy version of the current window. It can be called with no, one, or two arguments:

# Python
  print_window()
  print_window("fig")
  print_window("fig", ["format","png"])
  print_window("fig", ["fittopage",1,"pagesize","letter","clobber",1])
% S-Lang
  print_window;
  print_window("fig");
  print_window("fig", {"format","png"});
  print_window("fig", {"fittopage",1,"pagesize","letter","clobber",1})

If called with no arguments the plot is sent as a postscript file to the default printer, otherwise the first argument gives the start of the file name (the suffix is determined from the output format). The default output format (as given by the export.format preference setting) is "ps", so the second example creates a postscript format file called fig.ps. The third example shows how to override the format setting to create a PNG format file called fig.png. The following formats are available: ps, eps, pdf, png, and jpg.

The last example creates fig.ps, overwriting it if it already exists, and makes the output US letter sized (the aspect ratio of the on-screen plot will be retained since the default value for export.keepaspect is true).

The print_window() routine can be called more than once for the same visualization.



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.