       Program PLOT
c
c ***********************************************************************
c *                                                                     *
c *      Program PLOT - To plot the datafile created using "PLTPRG"     *
c *                                                                     *
c *       Programmed by Steven C. Fisher, DTNSRDC Code 1522             *
c *                                                                     *
c ***********************************************************************
c
      Integer Spchar,Xtop
c
      Virtual Akeep(28,50)
      Common/Ptype/Idev,Xtop,Spchar,Chscal,Chsc1
      Common/Pltfil/Lineno,Iterm
      Common/Graphp/Xr0,Yr0,Xr90,Yr90
      Common/Ends/Ireset,Icflag,Iout
c
c         Read in the plotting information
c
      Call Inplot
c
c         Set up the device to plot, and initialize the plot
c
      If (Idev .GT. 0) Then
         Call Startp
      Else
         Call Starti
      End If
c
c         Read in the labels, axes, and legend data
c
      Call Chaset
c
c         Draw a "Box" around the plot area
c
      Call Box
c
c        Add a legend
c
      Call Legend
c
c         Add text blocks
c
      Call Txtblk
c
c         Set up the axes
c
      Call Makeax
      Call Make2x
c
c        Label the plot
c
      Call Labelp
c
c         Draw the plot grid
c
      Call Gridd
c
c        Plot the data
c
      Call Cvplot
c
c        Go to the exit routine
c
      If (Idev .GT. 0) Then
         Call Ender
      Else
         Close(Unit=12)
         Close(Unit=14)
         Call Update(Akeep)
      End If
c
      End
      Subroutine PLCORD(Xmin,Xmax,Ymin,Ymax,Xlen,Ylen)
c
c ***********************************************************************
c *                                                                     *
c *        Subroutine Plcord - To set the plot coordinates              *
c *        of the window, depending if the primary or secondary         *
c *        axes are input                                               *
c *                                                                     *
c *        Programmed by Steven C. Fisher, DTNSRDC Code 1522            *
c *                                                                     *
c ***********************************************************************
c
      Common/Center/Xpmin,Xpmax,Ypmin,Ypmax,Xorg,Yorg,Xplotl,Yplotl
c
      Xhold = Xlen/(Xmax - Xmin)
      Yhold = Ylen/(Ymax - Ymin)
      X1 = (Xlen/2.0 - Xorg) / Xhold + Xmin
      X2 = (Xplotl - Xorg - Xlen/2.0) / Xhold + Xmax
      Y1 = (Ylen/2.0 - Yorg) / Yhold + Ymin
      Y2 = (Yplotl - Yorg - Ylen/2.0) / Yhold + Ymax
      Call Viewpt(0.0,Xplotl,0.0,Yplotl)
      Call Window(X1,X2,Y1,Y2)
      Return
      End
      Subroutine Plwin(Xmin,Xmax,Ymin,Ymax,Xlen,Ylen)
c
      Common/Center/Xpmin,Xpmax,Ypmin,Ypmax,Xorg,Yorg,Xplotl,Yplotl
c
      Call Viewpt(Xorg-Xlen/2.0,Xorg+Xlen/2.0,Yorg-Ylen/2.0,
     $         Yorg+Ylen/2.0)
      Call Window(Xmin,Xmax,Ymin,Ymax)
      Return
      End
