Next: Test Plotting Functions, Previous: Multiple Plot Windows, Up: Plotting Basics
The print command allows you to save plots in a variety of
formats. For example,
print -deps foo.eps
writes the current figure to an encapsulated PostScript file called foo.eps.
Print a graph, or save it to a file
filename defines the file name of the output file. If no filename is specified, output is sent to the printer.
options:
-Pprinter- Set the printer name to which the graph is sent if no filename is specified.
-color-mono- Monochrome or colour lines.
-solid-dashed- Solid or dashed lines.
-portrait-landscape- Plot orientation, as returned by "orient".
-ddevice- Output device, where device is one of:
psps2pscpsc2- Postscript (level 1 and 2, mono and color)
epseps2epscepsc2- Encapsulated postscript (level 1 and 2, mono and color)
texepslatexepslatexstandalonepstexpslatex- Generate a LaTeX (or TeX) file for labels, and eps/ps for graphics. The file produced by
epslatexstandalonecan be processed directly by LaTeX. The other formats are intended to be included in a LaTeX (or TeX) document. Thetexdevice is the same as theepslatexdevice.illaifm- Adobe Illustrator
cdrcorel- CorelDraw
dxf- AutoCAD
emf- Microsoft Enhanced Metafile
fig- XFig
hpgl- HP plotter language
mf- Metafont
png- Portable network graphics
pbm- PBMplus
svg- Scalable vector graphics
Other devices are supported by "convert" from ImageMagick. Type system("convert") to see what formats are available.
If the device is omitted, it is inferred from the file extension, or if there is no filename it is sent to the printer as postscript.
-Sxsize,ysize- Plot size in pixels for PNG and SVG. If using the command form of the print function, you must quote the xsize,ysize option. For example, by writing
"-S640,480".-Ffontname-Ffontname:size-F:size- fontname set the postscript font (for use with postscript, aifm, corel and fig). By default, 'Helvetica' is set for PS/Aifm, and 'SwitzerlandLight' for Corel. It can also be 'Times-Roman'. size is given in points. fontname is ignored for the fig device.
The filename and options can be given in any order.