## Producing Graphical Output

Two dimensional graphical output is supported by a specialised form of FrameSetFrameSet called a PlotPlot, whose base FrameFrame corresponds with the native coordinates of the underlying graphics system. Plotting operations are specified in physical coordinates which correspond with the Plot's current Frame. Typically, this might be a celestial coordinate system.

Three dimensional plotting is also supported, via the Plot3DPlot3D class - sub-class of Plot.

Operations, such as drawing lines, are automatically transformed from physical to graphical coordinates before plotting, using an adaptive algorithm which ensures smooth curves (because the transformation is usually non-linear). “Missing” coordinates (e.g. graphical coordinates which do not project on to the celestial sphere), discontinuities and generalised clipping are all consistently handled. It is possible, for example, to plot in equatorial coordinates and clip in galactic coordinates. The usual plotting operations are provided (text, markers), but a geodesic curve replaces the primitive straight line element. There is also a separate function for drawing axis lines, since these are normally not geodesics.

In addition to drawing coordinate grids over an area of the sky, another common use of the Plot class is to produce line plots such as flux against wavelength, displacement again time, etc. For these situations the current Frame of the Plot would be a compound Frame (CmpFrameCmpFrame) containing a pair of 1-dimensional Frames - the first representing the X axis quantity (wavelength, time, etc), and the second representing the Y axis quantity (flux, displacement, etc). The Plot class includes an option for axes to be plotted logarithmically.

Perhaps the most useful graphics function available is for drawing fully annotated coordinate grids (e.g. Figure 8).

Figure 8: A labelled coordinate grid for an all-sky zenithal equal area projection in ecliptic coordinates. This was composed and drawn via a Plot using a single function call.
[width=0.6]sun211_figures/gridplot_bw

This uses a general algorithm which does not depend on knowledge of the coordinates being represented, so can also handle programmer-defined coordinate systems. Grids for all-sky projections, including polar regions, can be drawn and most aspects of the output (colour, line style, etc.) can be adjusted by setting appropriate Plot attributes.

Further reading: For a more complete description of Plots and how to produce graphical output, see §21. Also see the Plot entry in Appendix D.