/FORMAT /FILE /TRANSPARENT
/FORMAT /FILE /TRANSPARENT /ANNOTATE=/XPIXELS= /YPIXELS= /XINCHES= /YINCHES=
Saves the current graphics display image as a graphics file. FRAME is also a qualifier for the "action" commands PLOT, CONTOUR, POLYGON, SHADE, VECTOR and WIRE.
yes? CONTOUR my_var yes? FRAME or more commonly, yes? FRAME/FILE=myvar.gif
Note that FRAME follows a command which creates an image.
[ in older versions of Ferret, FRAME/FORMAT=HDF appends an HDF raster 8 drawn to the specified or implied input file. This is not currently supported. ]
FRAME/FORMAT=GIF creates a new GIF file, renaming any existing GIF file with the specified or implied name using a relative version number. Note that if Ferret is running with an x-server, Ferret creates a GIF image by requesting the image back from your screen (your X server). This means that the X server normally has to be configured as pseudo-color. An alternative approach which does not share this restriction is to start Ferret with "ferret -gif"
In PyFerret, the formats include PNG, PDF, PS, and SVG, see below.
Ferret: only when Ferret is started with "ferret -gif"; saves the image, converting the white background to transparent.
In Pyferret FRAME/TRANSPARENT may be used when saving PDF or PNG images. Note that SET WINDOW/OPACITY= is another means of making a transparent image using PyFerret.
This means that the image can be overlaid on a background,
> ferret -gif yes? use coads_climatology yes? shade sst[L=1] yes? frame/trans/file=testbackground.gif
Then this image can be viewed against a background, for example a simple background color in html:
<html> <body bgcolor="gray"> <img src="testbackground.gif"/> </body> </html>
FRAME/FILE=filename specifies the name of the output file. If /FORMAT is not specified the output format is inferred from filename extensions of .gif, or .GIF [or in older versions of Ferret, .hdf, .HDF].
The maximum filename length, including path, that is allowable is 255 characters.
In PyFerret, the FRAME command is able to save the current plot in a variety of image formats, including PNG, PDF, PS and SVG. With PyFerret, the FRAME command can be called at any time, with either displayed or non-displayed plots, and has no effect on the current plot or its state.Thus, for PyFerret we recommend that you not use batch mode, or the -batch option, as the final plot can always be saved at whatever sizes and formats are desired using FRAME commands.
Save the image in PNG, PS, SVG or PDF format. If FORMAT=GIF is used, PyFerret will save a PNG image file and convert the name to a .png extension. If the /FORMAT option is not given the desired format is inferred from the extension of the filename given by the /FILE option: png for PNG, .jpg or .jpeg for JPEG, .ps for PostScript, .pdf for PDF, .svg for SVG.
Specifies the name of the output file. If /FORMAT is not specified the output format is inferred from filename extension of .png, .pdf, .ps, or .svg. If the filename has an extension of .gif, Pyferret will save a PNG formatted file and convert the file extension to .png.
FRAME /XPIXELS= /YPIXELS=
The /XPIXELS and /YPIXELS options to the FRAME command in PyFerret allows one to specify the pixel size of raster-type (PNG, JPEG) saved images.The current image is scaled to the desired size when saving it.Only one of these options may be given as the aspect ratio of the plot is always preserved.
FRAME /XINCHES= /YINCHES=
The /XINCHES and /YINCHES options to the FRAME command in PyFerret allows one to specify the inches size of vector-type (PostScript, PDF, SVG) saved images.The current image is scaled to the desired size when saving it.Only one of these options may be given as the aspect ratio of the plot is always preserved.
Note: experimental The /ANNOTATE option to the FRAME command in PyFerret can be used to add lines of annotations to the top of the saved plot. The height of the saved image will be increased so as to contain the annotations without changing the size of the plot underneath. The value given to the /ANNOTATE option should be a Ferret string variable. Each string in this variable will be start on a new line. Each string will be treated as text formatted using the Pango Markup Language(Note: this link goes to an external site) which is similar to HTML.