A simple example

As an introductory example to HPLOT consider an already existing program using HBOOK, where one wants to plot all created histograms saving all pictures into a GKS or PostScript metafile.
                       Simple HPLOT program
                                  
       PROGRAM TEST
       COMMON/PAWC/H(20000)
*
       CALL HLIMIT(20000)         ! Initialize HBOOK
       CALL HBOOK1(...            ! Book and fill histograms with HBOOK

       CALL HBOOK2(...
*
       CALL HISTDO                ! Print all histograms on lineprinter
*
       CALL HPLINT(0)             ! Initialize HPLOT
       CALL HPLCAP(-3)            ! Open metafile on unit 3
       CALL HPLOT(0,' ',' ',0)    ! Write all histograms to metafile
       CALL HPLEND                ! Close HPLOT
       END
On VM/CMS a file definition FILEDEF 3 DISK HPLOT METAFILE A (RECFM F LRECL 80 must have been made beforehand for the output metafile HPLOT METAFILE. The latter can be visualized on various devices as desired, e.g. with the GRVIEW utility if it is a GKS metafile or with any PostScript previewer if it is a PostScript file.