Most plotting packages are designed to be used on their own, and cannot be used in conjunction with any other package. In contrast, SGS has been designed to permit direct use of GKS, and it is also possible, with care, to use the NCAR routines in combination with SGS and GKS very effectively. However, NCAR and SGS/GKS are separate plotting systems and some care is necessary when switching back and forth between them.
Two packaged save/restore facilities exist within SNX to help do this. The most elaborate is the pair of routines SNX_AGSAV and SNX_AGRES (see §8), which are a complete save and restore for AUTOGRAPH. A simpler facility, which performs the necessary buffer flushing operations and saves/restores the SGS zone, is the SNX_TO routine. This is used as follows:
Plot with NCAR
CALL SNX_TO( 'SGS' )
Plot with SGS
CALL SNX_TO( 'NCAR' )
More plotting with NCAR
Only the first character of the argument is significant. The sequence must begin with the switch to SGS and then alternate strictly.
When you have just plotted something using an NCAR routine (or at least a low level one - the high level utilities do it for you) and wish to switch to SGS or GKS, make the following call:
CALL PLOTIT( 0, 0, 2 )
or if you are switching from SGS:
CALL SGS_FLUSH
or from GKS:
CALL GUWK( WKID, REGFL )
After plotting with AUTOGRAPH, further GKS or SGS work will require the coordinate systems to be re-established. In SGS this can be done as follows:
CALL SGS_ICURZ( IZ )
CALL SGS_SELZ( IZ )
This can be omitted if the routine SNX_AGCS is being called. Conversely, the NCAR coordinate systems will need to be saved and restored if there is intervening SGS or GKS plotting. This can be done by means of the SPPS routines GETSET and SET.
SNX --- Starlink Extensions to the NCAR Graphics Utilities