8 AUTOGRAPH Save and Restore

It can sometimes be useful to draw several graphs on one display frame and then to plot additional material to (or perform input from) one or more of them later. This can be accomplished by using the routines SNX_AGSAV and SNX_AGRES, which respectively save and restore the AUTOGRAPH context. Thus the sequence:

        Plot something with AUTOGRAPH
        CALL SNX_AGSAV( HEAP )
        Plot something else with AUTOGRAPH
        CALL SNX_AGRES( HEAP )

will leave AUTOGRAPH in the same state as it was after the first plot. HEAP is a 1-dimensional real array in which SNX_AGSAV stores all of AUTOGRAPH’s important variables. HEAP must currently be at least 2606 elements long; check the SNX_AGSAV source for the latest value. If you wish to save several different AUTOGRAPH states in one program, several HEAP arrays will of course be required.

When using this facility it will very often be necessary to switch SGS zone (with SGS_SELZ) as well as saving and restoring AUTOGRAPH. When this is done, a call to SNX_AGWV (§9.1) will be needed as well. See also §11.

The NCAR software includes its own AUTOGRAPH save/restore facility (AGSAVE, AGRSTR). This uses a scratch file, which means that a state saved in one program can be restored in another, but does not save the plotting context. It is thus most useful for plotting successive data sets with the same AUTOGRAPH parameters rather than (for example) making additions to a graph plotted earlier, something which is for that matter hard to do with GKS itself.