Last modified: 12 December 2018

How do I create a hardcopy version of my plot?


The ChIPS GUI, provides more means to access the print dialog window; in particular via the right-mouse-button menu in the ChIPS window.

The print_window routine creates a hardcopy version of the current window. It can be called with no, one, or two arguments:

print_window()
print_window("fig")
print_window("fig.png")
print_window("fig", ["format", "png"])
print_window("fig", ["fittopage", True, "pagesize", "letter", "clobber", True])
print_window("fig".pdf, ["fittopage", True, "pagesize", "letter", "clobber", True])

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 and fourth examples show 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-but-one 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.

Using a print dialog (GUI) to control the output

[The GUI contains options for changing the file name, format, size, orientation and more]

If print_window is called with printdialog set to True then a GUI is displayed which allows you to control how the output is created (such as the format, page size, and orientation). It can also be called directly from the ChIPS GUI.

This setting can be changed globally - so that all print_window calls will use the GUI - by saying

set_preference("export.printdialog", "true")

or just for an individual call by saying

print_window(["printdialog", True])

or, to seed the filename,

print_window("plot", ["printdialog", True])