Next: Compiling and Linking Software that Uses AST
Up: Producing Graphical Output (Plots)
Previous: Producing Logarithmic Axes
Choosing a Graphics Package
The Plot class itself does not include any code for actually drawing on a
graphics device. Instead, it requires a set of functions to be provided
which it uses to draw the required graphics. These include functions
to draw a straight line, draw a text string, etc. You may choose
to provide functions from your favorite graphics package, or you can even
write your own! To accomodate variations in the calling interfaces of
different graphics packages, AST defines a standard interface for these
routines. If this interface differs from the interface provided by your
graphics package (which in general it will), then you must write a set of
wrapper functions, which provide the interface expected by AST but
which then call functions from your graphics package to provide the
required functionality. AST comes with wrapper functions suitable for
the PGPLOT graphics package (see SUN/15).
There are two ways of indicating which wrapper functions are to be used by
the Plot class:
- A file containing C functions with pre-defined names can be written
and linked with the application using options of the ast_link command.
(see
and
). AST is
distributed with such a file (called grf_pgplot.c) which calls PGPLOT
functions to implement the required functionality. This file can be used
as a template for writing your own.
Currently, it is not possible to write such ``grf modules'' in Fortran.
If you want to use wrapper functions written in Fortran, then you must
use the AST_GRFSET method as described below.
- The
AST_GRFSET
method of the Plot class can be used to ``register''
wrapper functions at run-time. This allows an application to switch
between graphics systems if required. Graphics functions registered in
this way do not need to have the pre-defined names used in the link-time
method described above.
For details of the interfaces of the wrapper routines, see
the reference documentation for the AST_GRFSET method.
Next: Compiling and Linking Software that Uses AST
Up: Producing Graphical Output (Plots)
Previous: Producing Logarithmic Axes
AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 210
R.F. Warren-Smith & D.S. Berry
24th May 2011
E-mail:ussc@star.rl.ac.uk
Copyright (C) 2009 Science \& Technology Facilities Council