SAC Command Reference Manual

SAVEIMG

SUMMARY

Saves a display graphics window to an image file in a variety of formats

SYNTAX

[SAVE]IMG filename.format

INPUT

filename:

Filename for the saved image.

format:

Format for saved file from among one of the four choices:

  • ps (Postscript);
  • pdf (Portable Document Format);
  • png (Image file) [No longer included in the binary SAC package]
  • xpm (Pixmap format)

DESCRIPTION

This command will save a current plot to an image file format including Postscript (ps), Portable Document Format (pdf), Image file (png), and Pixmap file (xpm). The format is derived from the filename's extension.

An advantage of SAVEIMG to producing SGF files is that letters and numbers in .sgf files are made up of drawn line segments, while those in the .ps or .pdf images produced by SAVEIMG use the Postscript feature of producing fonts directly. Also, for many applications, a lower-resolution .png or .xpm file is sufficient. Because of potential problems with portability, the PNG format is not enabled in the default builds of SAC.

The title in a save xxx.pdf is made with a font that is larger than that used in a title for p1 or p1 print because in producing the PDF file, a postscript font (with higher resolution) is used.

It is possible to produce plots in .png format if one builds SAC from sources (see ${SACHOME}/README}.

Output .xpm and .png files will have the aspect ratio of the current window. (See WINDOW for instructions about choosing the size and aspect ratio of display windows.) The .pdf and .ps files produced by SAVEIMG will have a fixed aspect ratio of X/Y = 11/8.5 = 1.2941. To make the output .ps or .pdf file look most like a P1 or P2 output it is best to choose a display window aspect ratio of 1.2941.

As with .sgf files, the plots will not have a tight boundingbox. For .sgf files the script ${SACHOME}/bin/sgftoeps.csh will produce an EPS file with a tight boundingbox if the program Ghsostscript (gs) is in the path. Similar scripts could be written for the output files from SAVEIMG.

To save a plot using SAVEIMG, the plot must already be visible. SAVEIMG will not work in the SSS subprocess, but if one enters qs after creating the plot, SAVEIMG can then be used for that image. Also, if a frame has been opened to produce multiple panels in a single file, saveimg cannot be used until after the ENDFRAME command. See ${SACHOME}/aux/macros/demo for scripts with examples.

EXAMPLES

To save a spectrogram in three different formats:

SAC> fg seismo
SAC> spectrogram
SAC> save spectrogram.ps
SAC> save spectrogram.xpm
SAC> save spectrogram.pdf

The plots at the end of the CONVOLVE, CORRELATE, and TUTORIAL help file have an aspect ratio of 3.78 (because the larger aspect ratio takes less vertical space, which is useful if the plot is to be included in a docyment). The following commands can be used to produce such a plot file:

SAC> fg seismo
SAC> window 3 x .04 .94 y .48 .93 aspect 3.78
SAC> bw 3
SAC> p2
SAC> save seismo.xpm

LATEST REVISION

version 102.0