PGPLOT Extensions Part III

pgGet

Metafile disk files (created by pgSave) can be read back in to Dervish and the plots displayed on any supported Pgplot device (including Postscript). In this manner, plots can be saved, converted to postscript and then printed. This command uses the default directory and extension defined through the dirSet Tcl verb. TCL: pgGet <filename> [-o outputFilename] [-d outputDevice] <filename> Name of metafile to read in. This parameter may be a Tcl list of many metafile names. [-o outputFilename] Name of output file to create. This parameter is used in cases where the Pgplot device creates disk files (e.g. the Postscript driver). For these devices the default is the same as specified in the Pgplot manual and is device specific. If the above filename is a Tcl list, this parameter (if entered must be a Tcl list with the same number of elements. [-d outputDevice] The Pgplot device on which to display the plot(s). The default is /XWINDOW. Returns: TCL_OK Successful completion. TCL_ERROR Error occurred. The Interp result string will contain the error string.

pgSave

The verb pgSave can be used to save plots in a disk file in metafile format. In order to tell Dervish that you want any plots saved in a metafile, you must define the environmental variable PGPLOT_SAVE before creating the plots. PGPLOT_SAVE can be defined to anything. If this environmental variable exists, once you start a plot, all plotting commands are saved as metafile commands in a unique temporary file (in addition to being displayed on the current plotting device). After completing your plot(s) and after executing the pgEnd command, execute the pgSave command. This will copy the temporary file to a file of your choosing. This command uses the default directory and extension defined through the dirSet Tcl verb. If you create a plot and do not issue the pgSave command before starting another plot, the orignal metafile is lost. TCL: pgSave <outputFilename> <outputFilename> Name of metafile to create. Returns: TCL_OK Successful completion. TCL_ERROR Error occurred. The Interp result string will contain the error string.

pgGeomGet

The verb pgGeomGet will return the current geometry that pgplot will use to create a window. This geometry includes the window width (in pixels), window height (in pixels), upper left corner x position (in pixels) and upper left corner y position (in pixels). These values are returned in this order as a Tcl list. If there is no geometry set (no previous pgGeomSet command was issued and no values are defined in the .Xdefaults file) an error is returned. NOTE: an xrdb -merge .Xdefaults command must have been issued prior to running Dervish to allow the server access to the information in the .Xdefaults file.

Pgplot gets geometry information from 1 of 3 sources. These sources, in priority order (starting with the highest), are listed below.

  • Values entered by the user in a pgGeomSet command.
  • Values listed in the .Xdefaults file.
  • Default values calculated by pgplot at pgBegin time.
  • TCL: pgGeomGet Returns: TCL_OK Successful completion. The Interp result string will contain a list of the current geometry. TCL_ERROR Error occurred. The Interp result string will contain the error string.

    pgGeomSet

    The verb pgGeomSet will set the geometry used by Pgplot to create a window. TCL: pgGeomSet <width> <height> <x> <y> <width> Pixel width of the Pgplot window. <height> Pixel height of the Pgplot window. <x> Pixel position of the upper left corner of the Pgplot window on the x axis. <y> Pixel position of the upper left corner of the Pgplot window on the y axis. Returns: TCL_OK Successful completion. TCL_ERROR Error occurred. The Interp result string will contain the error string.