GrADS version 2.1 introduced the use of the Cairo library to handle all the graphics rendering, both for the interactive display in X windows and for the hardcopy and image outputs. The addition of Cairo means that GrADS can support drawing a wide variety of fonts, smoother looking anti-aliased lines, transparent colors, pattern filling, and more options for graphical output formats. These features provide an opportunity to create some beautifully polished publication-quality graphics.
Along with the introduction of the Cairo library came a major overhaul of the graphics code, which makes the rendering components more "pluggable" so that other options besides Cairo would be easier to implement in future versions. This overhaul necessitated some changes to the format of the GrADS metafile, which were long overdue but had been postponed in order to maintain backwards compatibility with all of the external metafile translators such as gxps, gxeps, gxtran, gv32, et al. The advent of version 2.1 means that those utilities are obsolete -- the metafile is now a metabuffer that exists only in memory during a GrADS session.
gxprint command was introduced in GrADS version 2.1. It replaces the
The remainder of this doc page is only relevant for versions 2.0.2 and earlier...
There are several GrADS commands that will convert the contents of the graphics window into an image file. The differences between them are the image formats they support and the way they are implemented in GrADS.
was introduced in version 1.8. It uses the GD library to produce a PNG, GIF, or JPG formatted image file based on the current
contents of the GrADS metabuffer, which is the stuff displayed in the
graphics window, minus any widgets.
printim will work in
batch mode. Beginning with version 2.1,
printim is an alias for
outxwd command draws the contents of the graphics display window to a file in XWD (X window dump) format. It does not work in batch mode. It is obsolete beginning with GrADS version 2.1.
wi command is not included in version 1.9 or later.
N.B. This protocol is obsolete beginning with GrADS version 2.1.
1. Set-up the GrADS metafile
The first step in creating hardcopy image output is to invoke the
enable print command -- this opens the output file
2. Display the image
The next step is to display the graphic that you want to print. When
you have finished, issue the
clear, create the new image, and then
3. Close the GrADS metafile
There are three way to close the output file:
N.B. This protocol is obsolete beginning with GrADS version 2.1. GrADS metacode files may be translated into postscript using the GrADS
gxeps. Both utilities will
prompt for input and output filenames, unless they
are provided on the command line. The input filename should be the
file created by the
gxeps to see
all the command line arguments and options.
gxeps are not
GrADS commands. They must be executed from the UNIX command line, or
preceded by a
executed as a shell command from the GrADS command line.
N.B. This protocol is obsolete beginning with GrADS version 2.1. There is a shortcut for creating an encapsulated postscript (EPS) file directly from within a GrADS session: use the
enable print command first. This shortcut allows the user to skip the steps of creating the GrADS metafile and invoking the external utility
gxeps. However, using this shortcut means there can only be one image per file, and none of the options available when invoking
gxeps directly can be used.
N.B. This protocol is obsolete beginning with GrADS version 2.1. GrADS metacode files may be displayed using the GrADS external utility
gxtran. The input
filename should be the file created by the
command. If the GrADS metafile contains more than one image,
gxtran will animate them.
The animation can be automatic or controlled by the user with carriage
returns. Please consult the gxtran reference page to
see all the command line arguments and options.
N.B. This protocol is obsolete beginning with GrADS version 2.1. The GrADS metafile Viewer (GV) allows you to view and manipulate GrADS graphics output files using Windows 95/NT. There are two files to download:
To open the metafile simply double click on a file listed in the File Manager or Explorer, drag and drop the file onto GV, or use the standard Open dialog box. GV assumes that default extension of GRADS metafiles is GMF. If your file includes more than one picture you can browse through pages using the keyboard keys (PageDown and PageUp) or the toolbar buttons.
Use the View commands and the View/Options dialog box to customize the image -- display it as black-and-white or color, change the line thickness, or clip and enlarge any part of the image. Use the right mouse button to access the most commonly used features.
There are two ways to save separate pages of a GRADS metafile as Windows Metafile (WMF): 1) use the File/Save Page As command, or 2) use the Edit/Copy command to copy the current page to the Windows Clipboard and then Edit/Paste it in your favorite Windows application that handles Windows Metafiles.
Use File/Print command to print a current document to any printer (you do not need a Postscript printer). Use File/Print Preview to display the active metafile as it would appear when printed.