Readers interested in the Native-PGPLOT version should refer to section Native-PGPLOT.
There are two ways in which the GKS version of PGPLOT can be used:
% f77 prog.f -L/star/lib ‘pgp_link‘
To use PGPLOT in an ADAM application, consult the ADAM Graphics Programmer’s Guide (SUN/113).
Any graphics device supported by GKS can be used with Starlink PGPLOT and device names are
translated using the graphics name service described in GNS – Graphics Name Service (SUN/57).
Device names containing a ‘/
’ character (such as UNIX file names) must be surrounded by quote (‘"
’)
characters.
If a question mark is typed in response to the prompt from PGBEG
, a list of those workstation names
defined on your system will be listed on the terminal.
On some hard copy devices the output from a PGPLOT program is a file and some further action (such as printing the file) is required to produce a plot. If you are unfamiliar with a particular device, consult SUN/83.
If one of the metafile workstations is selected the metafile can be tailored for a particular real
workstation type by appending /TARGET=workstation
to the device specification. The default target is
the monochrome A4 Postscript workstation. The resulting metafile can be played back on any
workstation but will be tailored with respect to such things as resolution, number of colour indices,
etc. for the selected target.
The device name syntax described in the PGPLOT manual is also supported; when using this form of device name, the device type is specified using a GNS workstation name.
On non-Starlink systems you may have to replace /star
by some other path name to locate
the files referred to in this section.
The directory /star/share/pgp
contains the source of a number of example programs which
demonstrate most of the features of PGPLOT. Binaries of the example programs can be found in
/star/bin/examples/pgp
.
They can be run with a command such as:
/star/bin/examples/pgp/pgdemon
where n
is between 1 and 14, provided that they have been installed. (They may not have been in
order to save disk space).
PGPLOT can be used to plot a picture in the current viewport on an already open GKS workstation.
When used in this way, the second argument to PGBEG
(normally the workstation name) is a GKS
workstation identifier (encoded as a character string). PGPLOT then behaves as if the region of the
display surface defined by the current viewport is a complete workstation. When PGEND
is called the
workstation is not closed but the state of GKS is restored to what it was at the time that PGBEG
was
called.
PGPLOT assumes that it has exclusive control over the GKS and so the only graphics calls allowed
between PGBEG
and PGEND
are PGPLOT routines and GKS inquiry routines.
The following simple example is a subroutine that uses PGPLOT to draw an X, Y plot in an SGS zone.
Because other plotting packages may have plotted on the same physical device, there are some restrictions when using PGPLOT in this way:
PGVSIZ
cannot be used.
PGPAGE
will never clear the screen. If the display surface has been divided into
sub-pictures PGPAGE
will move to the next sub-picture in the usual way.
PGBEG
unless the display surface is empty.