Skip to main content

PrintGraphs

PrintGraphs [ flags ] graphSpec [, graphSpec ]...

The PrintGraphs operation prints one or more graphs.

PrintGraphs prints one or more graphs on a single page from the command line or from a procedure. The graphs can be overlaid or positioned any way you want.

Parameters

The graphSpec specifies the name of a graph to print, the position of the graph on the page and some other options.

Flags

/C=numRenders graphs in black and white (num =0) or in color (num =1; default). Does not affect the Print or Page Setup dialogs.
/DDisables high resolution printing.
This flag is no longer supported and has no effect.
/G=groutSpecifies grout, the spacing between objects, for tiling in prevailing units.
/ICoordinates are in inches.
/MCoordinates are in centimeters.
/RCoordinates are in percent of page size (see example below).
/PD [=d ]Displays print dialog. This allows the user to use Print Preview or to print to a file.
If present the /PD flag must be the first flag.
d =0:Default. Prints without displaying the Print dialog.
d =1:Displays the Print dialog. /PD is equivalent to /PD=1.
d =2:Displays the Print Preview dialog. Requires Igor Pro 7.00 or later.
/SStacks graphs.
/TTiles graphs.

Details

Graph coordinates are in inches (/I) or centimeters (/M) relative to the top left corner of the physical page. If none of these options is present, coordinates are assumed to be in points.

The form of a graphSpec is:

graphName [(left, top, right, bottom)] [/F=f ] [/T]

Here are some examples:

// Take size and position from window size and position.
PrintGraphs Graph0, Graph1
// Specify size and position explicitly.
PrintGraphs/I Graph0(1, 1, 6, 5)/F=1, Graph1(1, 6, 6, 10)/F=1

If the coordinates are missing and the /T or /S flags are present before graphSpec then the graphs are tiled or stacked. If the coordinates are missing but no /T or /S flags are present then the graph is sized and positioned based on its position on the desktop.

Finally there are these graphSpec options, which appear after the graph name:

/F=fSpecifies a frame around the graph.
f =0:No frame (default).
f =1:Single frame.
f =2:Double frame.
f =3:Triple frame.
f =4:Shadow box frame.
/TGraph is transparent. This allows special effects when graphs are overlaid.
For this to be effective, the graph and its contents must also be transparent. Graphs are transparent only if their backgrounds are white. Annotations have their own transparent/opaque settings. PICTs may have been created transparent or opaque; an opaque PICT cannot be made transparent.

You can put an entire graphSpec into a string variable and use the string variable in its place. In this case the name of the string variable must be preceded by the $ character. This is handy for printing from a procedure and also keeps the PrintGraphs command down to a reasonable number of characters. For example:

String spec0, spec1, spec2
spec0 = "Graph0(1, 1, 6, 5)/F=1"
spec1 = "Graph1(1, 6, 6, 10)/F=1"
spec2 = "" // PrintGraphs will ignore spec2.
PrintGraphs/I $spec0, $spec1, $spec2

If you use a string for a graphSpec and that string contains no characters then PrintGraphs will ignore that graphSpec.

See Also

PrintSettings, PrintTable, PrintLayout, PrintNotebook