# plot1d.pro

At APS this program is installed in the /usr/local/epics/extensions/bin/$HOST_ARCH directory. This is a general purpose of 1D multi-line plot package.

# List of Routines

- PLOT1D

# Routine Descriptions

## PLOT1D

[List of Routines]

     NAME:
           PLOT1D

     PURPOSE:
           This routine provides a general purpose flexible cartesion plot
           package.  It provides simple to use automatic feature of labels,
           legend, comment, line style, symbols, and color options on plot.

           The window generated by this routine will be resizable by the
           window manager.

           Depress the 'Print' button will generate a postscript copy of the
           graph.

           Normally it accepts two parameters X and Y. If the first parameter
           is not used then the data array is plotted on the ordinate versus
           the point number on the abscissa.  Multiple curves (or variables)
           can be stacked into the second parameter as a two dimensional array,
           the first dimension gives the number of data points in each curve,
           the second dimension gives the number of curves to be plotted.

     CATEGORY:
           Widgets.

     CALLING SEQUENCE:

           PLOT1D, [X,] Y [,ID_TLB]  [,ID_DRAW]

     INPUTS:
           X:      The vector array for X abscissa.

           Y:      The Y data array for curve plot. The Y array can contain
                   more than one curve, the first dimension gives the number
                   of data to be plotted for the curve, the second dimension
                   gives the number of curves to be plotted.

     KEYWORD PARAMETERS:
           TITLE:  Set this keyword to specify the plot title string.

           XTITLE: Set this keyword to specify the xtitle string.

           YTITLE: Set this keyword to specify the ytitle string.

           COLOR:  Set this keyword to specify the color number used
                   in the plot routine.

          CURVFIT: Set this keyword if two curves are plotted, first curve
                   is the fitted curve, the second curve is data to be fitted.

           SYMBOL: Set this keyword to specify data plotted as symbol, set to -1
                   data plot as symbol and connected with line.

           XLOG:   Set this keyword to specify a logrithmic X axis.

           YLOG:   Set this keyword to specify a logrithmic Y axis.

           XRANGE: Set this keyword to specify the desired data range for
                   the X axis.

           YRANGE: Set this keyword to specify the desired data range for
                   the Y axis.

           XMARGIN: Set this keyword to specify the left and right margin,
                    default xmargin=[10,3]

           YMARGIN: Set this keyword to specify the bottom and top margin
                    default ymargin=[5,3]

           THICK:  Set this keyword to specify the line thickness for the
                   axes and the line plot.

           LINESTYLE:  Set this keyword to turn on different line style used.

           XSTYLE:  Set this keyword to control x axis in IDL plot routine.

           YSTYLE:  Set this keyword to control y axis in IDL plot routine.

           LEGEND:  Set the legend strings corresponding to curves drawn.

           XYLEGEND: Set the x,y location of the legend strings, % from the
                     lower left corner from the graph window, default
                     xylegend=[0.75, 0.35].

           COMMENT:  Set this keyword to write any footnotes on the graph.

           STAMP:  Set this keyword to put the time stamp and user ID on the page.

           WTITLE: Set this keyword to specify the window title string,
                   default to 'Plot1d'.

           WIDTH:  The initial window width at the creation time, which
                   default to 350 pixel.

           HEIGHT: The initial window height at the creation time, which
                   default to 350 pixel.

           GROUP:  The widget ID of the group leader of the widget. If this
                   keyword is specified, the death of the group leader results
                   in the death of PLOT1D.

           BUTTON: Set this keyword if no print and close buttons are desired
                   for the PLOT1D widget.

           CLEANUP: Set this keyword if the created window can no be closed by the
                    window manager is desired.

     OPTIONAL_OUTPUTS:
           ID_TLB: The widget ID of the top level base returned by the PLOT1D.

           ID_DRAW: The widget ID of the drawing area used by the PLOT1D.

     COMMON BLOCKS:
           None.

     SIDE EFFECTS:
           If more than one curves are stored in the Y array, it automatically
           uses different color for each curve. If the color keyword is set
           by the user, then the specified color will be used for the whole plot.

     RESTRICTIONS:
           It is assumed that the X position array is the same for multiple
           curve plot.

     EXAMPLES:
           Create a resizable line plot without any title or label
           specification.

               x = !pi * indgen(100)/25
               PLOT1D, x, sin(x)

           Create a resizable line plot with title specifications.

               PLOT1D, x, sin(x), title='title', xtitle='xtitle', ytitle='ytitle'

           Plot two curves with different linestyle and legend at default location.

               x=indgen(100)
               y=make_array(100,2)
               y(0,0)=sin(x * !pi / 50)
               y(0,1)=cos(x * !pi / 50)
               PLOT1D,x,y,legend=['line1','line2'],/linestyle

           Same as the above example plus symbol and a specified legend location.

               x=indgen(100)
               y=make_array(100,2)
               y(0,0)=sin(x * !pi / 50)
               y(0,1)=cos(x * !pi / 50)
               PLOT1D,x,y,/linestyle,symbol=-1, $
                  legend=['line1','line2'], xylegend=[0.5,0.9]

           Plot x,y array plus two lines of comment and a time stamp on the graph.

               PLOT1D,x,y,comment=['Comment line1','Comment line2'],/stamp

     MODIFICATION HISTORY:
           Written by:     Ben-chin K. Cha, Mar. 7, 1996.

           04-26-96 bkc   Add the window cleanup keyword
           10-28-96 bkc   Add the xstyle and ystyle keywords
           07-01-97 bkc   Comment out LOADCT,39 inherit color from parent process
           08-11-97 bkc   Add the curvfit support, only two curves allowed
           12-22-97 bkc   Add the 24 bit color visual device support
           09-04-98 bkc   Fix the plot problem due to ymax eq ymin

(See plot1d.pro)