Name Action Page HPLABL to define alphanumeric labels lists HPLAER to draw asymetric error bars HPLARC to draw an arc of circle HPLAX to add a comment to the axes HPLBOX to draw a box on the picture HPLCAP to switch or/off metafile output HPLCOM to add a comment HPLCON to draw a contour plot HPLDO to plot all histograms (like HISTDO) HPLEGO to plot a scatter plot as a 3 dim view HPLEND to terminate HPLOT HPLERR to draw error bars HPLFRA to define (and draw) a frame HPLFUN to draw a function HPLGIV to return size of the current zone HPLINE to draw straight lines HPLINT to initialize HPLOT HPLKEY to draw a symbol and its explanation HPLNT to plot a N-tuple HPLNUL to draw a picture or zone frame HPLNXT user routine called before each new frame HPLOC for graphics input HPLOPT to define options HPLOT to plot histograms or plots HPLPRO to plot a scatter plot and its projections HPLPTO wait after each plot HPLSET to redefine parameters HPLSIZ to set or read picture dimensions HPLSOF to draw software characters HPLSUR to plot a scatter plot as a 3 dim view HPLSYM to draw symbols on the picture HPLTAB to draw an histogram as a table HPLTIT to draw a title HPLUSR user routine called after each plot HPLWIR to draw cross-wires on a picture. HPLZOM to zoom a picture HPLZON to split the picture into zones
+------------------------------+
| CALL HPLABL (NUM, NB, CHLAB) |
+------------------------------+
Action: By default, labels used by axis are numeric labels. This routine,
allows the user to define up to nine alphanumeric set of labels (numbered
from 1 to 9). These labels can then be used in
subsequent calls producing axis. This routine limits the lenght of the
alphanumeric labels at 32 characters.
Parameter Description:
+----------------------------------------------------------------------+
| CALL HPLAER (XU ,YU, DXU1, DXU2, DYU1, DYU2, N, KICASE, ISYM, USIZE) |
+----------------------------------------------------------------------+
Action: Allows the user to draw his own (asymetric) error bars on the
picture. Error bars computed by HBOOK are automatically plotted by HPLOT.
They can, however, be turned off via the routine HPLOPT with the option
'NEAH' (``No Errors And Histogram''). The character with code
ISYM is plotted at the point given by the coordinates
(XU,YU)
Parameter Description:
+--------------------------------------+
|CALL HPLARC (XC, YC, RAD, PHI1, PHI2) |
+--------------------------------------+
Action: Draws an arc of circle.
Parameter Description:
+----------------------------+
|CALL HPLAX (CHXTIT, CHYTIT) |
+----------------------------+
Action: Prints titles along the X and/or Y axes of the plot.
Parameter Description:
+------------------------------------------+
|CALL HPLBOX (XLOW, YLOW, XUP, YUP, CHOPT) |
+------------------------------------------+
Action: Draws a rectangular box on the picture. The area delimited by the
rectangle is filled according to the fill area interior style index and
fill area style index set in HPLSET with parameter BTYP, and to the fill
area colour index set in HPLSET with parameter BCOL. The contour is always
drawn.
Parameter Description:
+--------------------+
|CALL HPLCAP (IFILE) |
+--------------------+
Action: Changes the status of metafile and terminal output.
Parameter Description:
+----------------------------+
|CALL HPLCOM (XM, YM, CHTIT) |
+----------------------------+
Action: Adds a comment on the picture.
Parameter Description:
+--------------------------------+
|CALL HPLCON (ID, NLEVEL, IFLAG) |
+--------------------------------+
Action: Draws a contour plot from a 2 dim histogram.
Parameter Description:
+------------------+
| CALL HPLDO (LUN) |
+------------------+
Action: This routine is the HISTDO. It is equivalent
to:
CALL HPLINT(LUN)
CALL HPLOT(0,' ',' ',0)
CALL HPLEND
+----------------------------+
|CALL HPLEGO (ID,THETA, PHI) |
+----------------------------+
Action: Plots two-dimensional histograms as solid objects viewed from
infinity. The ``object'' can be rotated specifying the polar coordinates
THETA and PHI.
Parameter Description:
+--------------+
| CALL HPLEND |
+--------------+
Action: Terminates the HPLOT package, and writes the termination page on
the line printer. This gives the total number of plots produced and the
number of plots stored as HIGZ pictures (see HPLOPT for option 'ZFL ').
Remark:
HPLEND must be called after all other HPLOT routines.
+------------------------------------------------------+
|CALL HPLERR (XU, YU, DXU, DYU, N, CHOPT, ISYM, USIZE) |
+------------------------------------------------------+
Action: Allows the user to draw his own error bars on the picture. Error
bars computed by HBOOK are automatically plotted by HPLOT. They can,
however, be turned off via the routine HPLOPT with the option 'NEAH' (``No
Errors And Histogram''). The character with code ISYM is plotted
at the point given by the coordinates (XU,YU)
Parameter Description:
+------------------------------------+
|CALL HPLFRA (X1, X2, Y1, Y2, CHOPT) |
+------------------------------------+
Action: Defines (and draws) a frame. By defaults axis labels and tick
marks are drawn.
Parameter Description:
+--------------------------------+
| CALL HPLFUN (XU, YU, N, CHOPT) |
+--------------------------------+
Action: Draws a smooth curve (splines) on the picture. The curve will pass
through all the points and will be smoothed to form a line as a function
of X. If the option AST has been set on with the routine
HPLOPT, each point (XU(I),YU(I)) is stamped with a star.
Parameter Description:
+----------------------------------+
| CALL HPLGIV (XL*, YL*, XH*, YH*) |
+----------------------------------+
Action: Returns the lower and upper coordinates of the current zone in cm.
Parameter Description:
+--------------------------------+
| CALL HPLINE (XU, YU, N, CHOPT) |
+--------------------------------+
Action: Draws a polyline on the picture.
Parameter Description:
+--------------------+
|CALL HPLINT (IWTYP) |
+--------------------+
Action: Initialises the HPLOT package and especially the graphic package
environment (HIGZ).
Parameter Description:
+----------------------------------+
|CALL HPLKEY (XC, YC, ISYM, CHTIT) |
+----------------------------------+
Action: Draws a symbol and its explanation. The symbol numbers are the
same as for HPLSYM, and HPLKEY provides a convenient method of annotating
the different symbols on a plot.
Parameter Description:
+----------------------------------------------------------+
| CALL HPLNT (IDN, ISEL, UWFUNC, IFROM, ITO, IVARX, IVARY) |
+----------------------------------------------------------+
Action: Draws two variables of an Ntuple as a scatterplot.
Parameter Description:
Example of the use of HPLNT
.
.
.
.
EXTERNAL WFUNC
*
* To plot X(7) versus X(3) for the 5000 first events
* of Ntuple 10 using the selection option 1.
*
CALL HPLNT(10,1,WFUNC,1,5000,3,7)
.
.
.
FUNCTION WFUNC(X,ISEL)
DIMENSION X(*)
WFUNC=0.
*
IF(ISEL.EQ.1)THEN
IF(X(2)**2 +X(3)**2.LT.0.)WFUNC=1.
ELSEIF(ISEL.EQ.2)THEN
IF(X(2)**2 +X(3)**2.GT.5.)WFUNC=1.
ELSE
WFUNC=X(5)
ENDIF
END
Remark:
+--------------+
| CALL HPLNUL |
+--------------+
Action: Draws a box in place of the histogram box and its contents.
Remark:
HPLNUL allows the user to draw a box for his own requirements. If
windowing is in use ( HPLZON), HPLNUL draws the box in the appropriate
position. If windowing is not in use, or if HPLNUL draws a box on a new
page, then the page number and the global title (if present) will also be
drawn.
Routines HPLAX, HPLBOX, HPLCOM, HPLINE, HPLTIT, etc., can all be used to
add information to the box. It is also possible to superimpose a histogram
with:
CALL HPLOT(ID,'S',' ',0)
in which case no axis values or tick marks will be drawn.
+--------------+
| CALL HPLNXT |
+--------------+
Action: This is an HPLOT User routine. The user should not call it but
provide, if he wishes, his own version to replace the do-nothing version
automatically provided by HPLOT. This routine is called before each
graphics clear screen operation i.e. it is intended to be used to pause an
interactive program at the end of a graphics frame and, if required, to
change program flow.
On some systems graphics input/output and Fortran input/output cannot be
intermixed and in most systems Fortran input/output will simply start its
text from wherever the graphics cursor was positioned. For these reasons
an auxiliary HPLOT routine, called HPLPTO, to do simple text output and
wait for input via graphics rather than Fortran has been provided.
Example of the use of HPLNXT
SUBROUTINE HPLNXT
* Optional user routine called before a new frame
CHARACTER*30 STROUT,STRIN
*
DATA STROUT/'TYPE QUIT OR RETURN'/
* Issue a graphics prompt and read keyboard
CALL HPLPTO(STROUT,STRIN)
* Check for quit
IF(STRIN.NE.'QUIT') RETURN
* Clean up and stop
CALL HPLEND
STOP 99
END
+--------------------------------------------------------------------+ | CALL HPLOC (NTPRI, NTLOC*, XLOC*, YLOC*, IDH*, ICX*, ICY*, ISTAT*) | +--------------------------------------------------------------------+Action: Picks a point on the current displayed picture and returns the information, related to the corresponding histogram. Picking is done with locator number 1. Parameter Description:
+----------------------+
|CALL HPLOPT (CHOPT,N) |
+----------------------+
Action: Allows the user to change the options defined by default in
HPLINT. HPLOPT can be called any number of times, each option remaining in
effect until modified by a further call to HPLOPT.
Parameter Description:
Table 0.1: Overview of the HPLOPT options [tab:hplopt]
+-----------+-----------+-------------------------------------------------------+
+-Default---+-Alternative-Effect------------------------------------------------+
| ' ' | 'A0', | Picture size. Predefined options are: A0, A1, A2, |
| | 'A1',... | A3, A4, A5, A6 |
| 'NOPG' | '*P','**P', Suppresses ('NOPG') or adds a 1, 2 or 3 digit page |
| | '***P' | numbers to a plot (Each '*' stands for a |
| | | digit). The page numbers are incremented |
| | | automatically |
| 'NEAH' | 'EAH' | Plots Errors bars And Histogram, if both are |
| | | present |
| | | |
| 'VERT' | 'HORI' | Vertical or horizontal orientation of paper |
| 'NAST' | 'AST' | Functions are drawn with ('AST ') or without |
| | | ('NAST') asterisks in each channel. |
| 'NCHA' | 'CHA' | Scatter plot are plotted with dots randomised |
| | | within each bin ('NCHA') or by printing a single |
| | | character in the middle of the bin ('CHA ') |
| 'SOFT' | 'HARD' | Use SOFTware or HARDware characters |
| 'TAB ' | 'NTAB' | tables ( HTABLE) are plotted as tables ('TAB ') or |
| | | as scatter plots ('NTAB') |
+-----------+-----------+-------------------------------------------------------+
Table 0.1: Overview of the HPLOPT options (continued)
+-Default---+-Alternative-Effect------------------------------------------------+
+-----------+-----------+-------------------------------------------------------+
| 'HTIT' | 'UTIT' | Option for printing titles. 'HTIT' means use the |
| | | HBOOK titles, while 'UTIT' signals the use of user |
| | | titles |
| 'LINX' | 'LOGX' | The scale for the X axis is linear or logarithmic. |
| 'LINY' | 'LOGY' | The scale for the Y axis is linear or logarithmic. |
| | | Note that if in HBOOK the HIDOPT option 'LOGY' or |
| | | HLOGAR was selected for a particular ID |
| | | and if neither options 'LINY' nor 'LOGY' are |
| | | selected then the scale will be logarithmic. If |
| | | HIDOPT with option 'LOGY' was called and |
| | | the option 'LINY' is selected then the scale will |
| | | be linear |
| 'LINZ' | 'LOGZ' | The scale for the Z axis is linear or logarithmic |
| | | (for lego plots or surfaces). |
| 'BOX ' | 'NBOX' | By default a rectangular box is drawn around a |
| | | picture. 'NBOX' suppresses this box |
| | | |
| 'NTIC' | 'TIC' | Cross-wires are drawn ('TIC ') or not drawn |
| | | ('NTIC') after each plot |
| 'NSTA' | 'STA' | Statistics information are printed ('STA ') or not |
| | | printed ('NSTA') on the picture |
| 'NFIT' | 'FIT' | Fit parameters are printed ('FIT ') or not printed |
| | | ('NFIT') on the picture |
| 'NZFL' | 'ZFL' | The picture is stored ('ZFL ') or not stored |
| | | ('NZFL') in a ZEBRA data base The procedure to |
| | | create a HIGZ picture is given below. |
| 'NZFL' | 'ZFL1' | 'ZFL1' has the same effect as 'ZFL ', but only the |
| | | picture last created is kept in memory. |
| 'NPTO' | 'PTO' | ``Please Turn Over''. With 'PTO ' a carriage return |
| | | is requested between each new plot. |
| | | |
| 'NBAR' | 'BAR' | 1-dimensional histograms are plotted as ``Bar |
| | | charts'' ('BAR ') or as contours ('NBAR') |
| 'DVXR' | 'DVXI' | Real ('DVXR') or integer ('DVXI') labels are |
| | | computed for the X axis |
| 'DVYR' | 'DVYI' | Real ('DVYR') or integer ('DVYI') labels are |
| | | computed for the Y axis |
| 'GRID' | 'NGRI' | Grid on X and Y axis |
| 'NDAT' | 'NDAT' | The date is printed or not on each plot |
| 'NFIL' | 'NFIL' | The file name is printed or not on each plot |
+-----------+-----------+-------------------------------------------------------+
Remarks:
+------------------------------------+
|CALL HPLOT (ID, CHOPT, CHCASE, NUM) |
+------------------------------------+
Action: Plots histogram ID.
Parameter Description:
first histogram ------ solid line second histogram ---- (dash,blank,dash,blank) third histogram . . . (dot,blank,dot,blank) fourth histogram .-.-- (dash,dot,dash,dot) fifth histogram ..... (dot,dot,dot,dot)If more than five histograms are superimposed, HPLOT will loop round the symbols again. If three histograms are to be superimposed, but the second histogram requested does not exist, the third histogram will still be plotted with the third symbol ( . .). Similarly if the second histogram is a scatter plot, the third histogram will take the third symbol.
Example of the use of the option K and U
program dice
common /pawc/ h(100000)
*.___________________________________________
*
call igwkty(kwtype)
call hlimit(100000)
call hplint(kwtype)
*
n = 1000
ifirst = 1
call hplset('HCOL',1001.)
call hplset('NDVX',-11.05)
call hplopt('STAT',1)
call hbook1(3,'Playing with two dice',11,2.,13.,0.)
do j=1,n
ix1=6.*rndm(.01234)+1
ix2=6.*rndm(.56789)+1
call hfill(3,float(ix1+ix2),0.,1.)
if (ifirst.eq.1) then
call hplot(3,'BK',' ',0)
ifirst=0
else
call hplot(3,'BU',' ',0)
endif
call igterm
enddo
*
end
Two random numbers between 1 and 6 are generated and the histogram is
filled with the sum of this numbers to simulate dice playing. The first
time the histogram is plotted the option ``LitK'' is used to keep in
memory a copy of the histogram in order to update it later. With the
``U'' option, HPLOT looks at the current kept histogram contents
and update the plot with the new contribution without redrawing
everything. This mechanism is used in data acquisition. The statistics are
also updated.
+----------------------------------+
| CALL HPLPRO (ID, CHXTIT, CHYTIT) |
+----------------------------------+
Action: Draws a scatter plot and its X and Y projections (if present) on a
plot with 2 by 2 zones. Separate titles may be given to the projections if
required.
Parameter Description:
+----------------------------+
|CALL HPLPTO (STROUT, STRIN) |
+----------------------------+
Action: Displays the CHARACTER variable specified in the bottom left hand
corner of the screen during an interactive graphics session, waits for
some user keyboard input and returns the input (which may be just carriage
return) in a CHARACTER variable.
Parameter Description:
+--------------------------+
| CALL HPLSET (CHOPT, VAR) |
+--------------------------+
Action: Sets one HPLOT parameter (see table
for more details). Note that if HPLSET in invoked
with a parameter not describe in the table
, the HIGZ routine IGSET is invoked with the same
parameter value. If the parameter value is again not correct for IGSET,
then an error message is displayed.
Parameter Description:
Example of HCOL specification
Ex:
+---- The Histogram is filled
|+--- The border color is 2
||++- The inside color is 3
||||
VVVV
CALL HPLSET('HCOL',1203.)
The same mechanism is also available for FCOL, BCOL and PCOL.
'X'FON = 10*IFON + IPREC
where IFON and IPREC correspond respectively to the HIGZ
attributes for ``Text Font'' and ``Precision''.
Example of NDVX specification
CALL HPLSET('NDVX',i) e.g. CALL HPLSET('NDVX',512.)
or
CALL HPLSET('NDVX',i.jk) e.g. CALL HPLSET('NDVX',10.25)
In the first case the number i contains 100 times the
number of secondary divisions plus the number of primary divisions. (e.g.
512 means 12 primary and 5 secondary division.
By adding 10000 times N3 to i a third level of
divisions is available.
In the second case the number in front of the dot (i) indicates
the total number of divisions, the first digit following the dot
(j) the label identifier: LABNUM (see HPLABL) (if this
number is equal to 0 numeric labels are drawn). The second digit
after the (k) dot indicates the position where the labels have to
be drawn (i.e. the text justification parameter, in this case 5,
indicating horizontally written text centered on the interval). Study
figures
[more info] and
[more info] for details.
These two figures show that the labels can be centered on the tick marks
(1 to 4) or on the divisions (5 to 8).
If the labels are centered on the tick marks, note that the number of
items defined by the routine HPLABL must be equal to the number of tick
marks (which is equal to the number of divisions plus one), otherwise the
last alphanumeric label on the axis will be undefined. By default, the
number of primary divisions given by CALL HPLSET('NDVX',n),
CALL HPLSET('NDVY',n) or CALL HPLSET('NDVZ',n) is
optimized to have a reasonable labelling. If the number of divisions has
to be exactly equal to the number given by HPLSET, a negative value must
be used i.e.:
Forcing an exact number of divisions
CALL HPLSET('NDVX',-i) e.g. CALL HPLSET('NDVX',-512.)
or
CALL HPLSET('NDVX',-i.jk) e.g. CALL HPLSET('NDVX',-10.25)
Table 0.2: Overview of the HPLSET options [tab:hplset]
+-CHOPT--+-VAR-(default)--+-Explanation--------------------------------------+
+--------+-------------------------+--------------------------------------------------+
| XSIZ | 20.00cm | length of picture along X |
| YSIZ | 20.00cm | length of picture along Y |
| XMGL | 2.00 cm | X margin left |
| XMGR | 2.00 cm | X margin right |
| YMGL | 2.00 cm | Y margin low |
| YMGU | 2.00 cm | Y margin up |
| | | |
| XWIN | 2.00 cm | X space between zones |
| YWIN | 2.00 cm | Y space between zones |
| XLAB | 1.40 cm | distance Y axis to labels |
| YLAB | 0.80 cm | distance X axis to labels |
| XVAL | 0.40 cm | distance Y axis to axis values |
| YVAL | 0.20 cm | distance X axis to axis values |
| | | |
| XTIC | 0.30 cm | X axis tick mark length |
| YTIC | 0.30 cm | Y axis tick mark length |
| YNPG | 0.60 cm | Y position for number of page |
| YGTI | 1.50 cm | Y position of global title |
| YHTI | 1.20 cm | Y position of histogram title |
| KSIZ | 0.28 cm | Hershey character size (cf. HPLKEY) |
| | | |
| GSIZ | 0.28 cm | global title size |
| TSIZ | 0.00 cm | histogram title size |
| ASIZ | 0.28 cm | axis label size |
| CSIZ | 0.28 cm | comment size |
| PSIZ | 0.28 cm | page number size |
| VSIZ | 0.28 cm | axis values size |
| | | |
| SSIZ | 0.28 cm | asterisk size (for functions) |
| 2SIZ | 0.28 cm | scatter plot and table character. size |
| HMAX | 0.90 cm | histogram maximum for scale |
| PASS | 1. | number of pass for software characters |
| CSHI | 0.03 | character shift between two pass |
| BARO | 0.25 | bar offset for ``bar charts'' |
| | | |
| BARW | 0.5 | bar width for ``bar charts'' |
| DASH | 0.15 | length of basic dashed segment for dashed lines |
| DMOD | 1 | line style for histogram contour (see HPLOT) |
| GRID | 3 | grid line type |
| DATE | 2 | date position |
| FILE | 1 | file name position |
| | | |
| STAT | 1111 | stat values to be plotted |
| FIT | 101 | fit values to be plotted |
| HTYP | 0 | histogram fill area style index |
| BTYP | 0 | zone fill area style index |
| PTYP | 0 | picture fill area style index |
| FTYP | 0 | function fill area TYPe |
+--------+-------------------------+--------------------------------------------------+
Table 0.2: Overview of the HPLSET options (continued)
+-CHOPT--+-VAR-(default)--+-Explanation--------------------------------------+
+--------+-------------------------+--------------------------------------------------+
| HCOL | 1 | histogram fill area colour index |
| BCOL | 1 | zone fill area colour index |
| PCOL | 1 | picture fill area colour index |
| FCOL | 1 | function fill area COLor |
| XCOL | 1 | X axis COLor |
| YCOL | 1 | Y axis COLor |
| | | |
| HWID | 1 | histogram line width |
| BWID | 1 | box line width |
| PWID | 1 | picture line width |
| FWID | 1 | function line width |
| XWID | 1 | X ticks width |
| YWID | 1 | Y ticks width |
| | | |
| TFON | 2 | general text (comments) font |
| GFON | 2 | global title font |
| VFON | 2 | axis values font |
| LFON | 2 | axis labels font |
| CFON | 2 | comment font |
| NDVX | 10510.00 | number of divisions for X axis |
| | | |
| NDVY | 10510.00 | number of divisions for Y axis |
| NDVZ | 10510.00 | number of divisions for Z axis |
| FPGN | 1 | first PaGe Number |
+--ERRX--+-------------------0.50--+-error-on-X-(%-of-bin-width)----------------------+
Figure: A graphical view of the HPLSET parameters.
Figure: [
The HPLSET parameters PTYP, BTYP and HTYP]The HPLSET parameters PTYP, BTYP, HTYP
+--------------------------------------+
|CALL HPLSIZ (*XSIZE*, *YSIZE*, CHOPT) |
+--------------------------------------+
Action: Sets or reads picture size.
Parameter Description:
+------------------------------------------------------+
| CALL HPLSOF (X, Y, CHTXT, SIZE, ANGLE, SIZMAX, IOPT) |
+------------------------------------------------------+
Action: Draw software characters.
Parameter Description:
+----------------------------------+
|CALL HPLSUR (ID,THETA, PHI, MODE) |
+----------------------------------+
Action: Plots two dimensional histograms as solid objects viewed from
infinity. The ``object'', can be rotated over a certain angle.
Parameter Description:
+------------------------------------------+
|CALL HPLSYM (X, Y, N, ISYM, USIZE, CHOPT) |
+------------------------------------------+
Action: Draws symbols or points on a picture.
Parameter Description:
+------------------------------------+
| CALL HPLTAB (ID, NPAR, PAR, CHOPT) |
+------------------------------------+
Action: Draws a table with the histogram ID according to the value of
CHOPT.
Parameter Description:
HPLTAB example
program hplotlego
*
dimension par(6)
common /pawc/ h(100000)
*.___________________________________________
*
call igwkty(kwtype)
call hlimit(100000)
call hplint(kwtype)
call hplmak
*
call vzero(par,6)
call hplsiz(9.,9.,' ')
call hplset('YGTI',0.3)
call hplset('XMGL',1.)
call hplset('YMGL',2.)
call hplset('XMGR',1.)
call hplset('YMGU',0.5)
call hplset('VSIZ',0.15)
call hplset('YHTI',1.5)
call hplset('MTYP',1.)
call doeps(par,'SCAT')
call doeps(par,'BOX')
call doeps(par,'ARR')
call doeps(par,'CONT')
call doeps(par,'COL')
call doeps(par,'TEXT')
call doeps(par,'CHAR')
par(1) = 30.
par(2) = 30.
call doeps(par,'LEGO')
call doeps(par,'LEGO1')
call doeps(par,'LEGO2')
call doeps(par,'SURF')
call doeps(par,'SURF1')
call doeps(par,'SURF2')
call doeps(par,'SURF3')
call doeps(par,'SURF4')
call doeps(par,'LEGOPOL')
call doeps(par,'LEGOCYL')
call doeps(par,'LEGOSPH')
call doeps(par,'LEGOPSD')
call doeps(par,'SURFPOL')
call doeps(par,'SURFCYL')
call doeps(par,'SURFSPH')
call doeps(par,'SURFPSD')
call hplend
end
subroutine doeps(par,chopt)
character*(*) chopt
character*32 name
name = 'hplot'
name(6:) = chopt
call cutol(name(6:))
open(unit=10,file=name(1:lenocc(name))//'.eps'
+, form='formatted',status='unknown')
call igmeta(10,-113)
call hpltab(200,6,par,chopt)
call igterm
call igmeta(999,0)
close(10)
end
subroutine hplmak
*
* Creation of some histograms (based on HBOOK examples)
*
common /hex2/ c1,c2,xm1,xm2,xs1,xs2
external htfun1,htfun2
*.___________________________________________
*
c1 = 1.
c2 = 0.5
xm1 = 0.3
xm2 = 0.7
xs1 = 0.07
xs2 = 0.12
*
call hbfun2(200,'Test of 2-DIM plots',40,0.,1.,40,0.,1.,htfun2)
*
end
function htfun1(X)
common /hex2/ c1,c2,xm1,xm2,xs1,xs2
*
a1 = -0.5*((x-xm1)/xs1)**2
a2 = -0.5*((x-xm2)/xs2)**2
x1 = c1
x2 = c2
if(abs(a1).gt.1.e-4)x1 = c1*exp(a1)
if(abs(a2).gt.1.e-4)x2 = c2*exp(a2)
htfun1 = x1+x2
end
function htfun2(x,y)
htfun2 = 100.*htfun1(x)*htfun1(y)
end
+-+--------------------------------------------------------------------------------------------+-+ +-+-CHOPT-=-'SCAT'-Scatter-plot-----------------------------------------------------+----------+-+ | | PAR index | PAR values | default | | +-+-----1------+-Marker-type-see- ISMK.----------------------------------------------+------1.--+-+ | | | | | | | | 2 | Maximum number of random points per cell | 50. | | | | 3 | ZMIN Lowest Z value | ZMIN | | | | 4 | ZMAX Highest Z value | ZMAX | | | | 5 | 1000*IXMIN + IXMAX (Useful for ZOOM) | 1-NX | | | | 6 | 1000*IYMIN + IYMAX (Useful for ZOOM) | 1-NY | | +-+------------+--------------------------------------------------------------------+----------+-+
Figure: Example of HPLTAB with SCAT option
+-+--------------------------------------------------------------------------------------------+-+ +-+-CHOPT-=-'BOX'-Boxes-------------------------------------------------------------+----------+-+ | | PAR index | PAR values | default | | +-+------------+--------------------------------------------------------------------+----------+-+ | | 1 | Not used | | | | | 2 | Not used | | | | | 3 | ZMIN Lowest Z value | ZMIN | | | | 4 | ZMAX Highest Z value | ZMAX | | | | 5 | 1000*IXMIN + IXMAX (Useful for ZOOM) | 1-NX | | | | 6 | 1000*IYMIN + IYMAX (Useful for ZOOM) | 1-NY | | +-+------------+--------------------------------------------------------------------+----------+-+
Figure: Example of HPLTAB with BOX option
+-+-CHOPT-=-'ARR'-Arrows-----------------------------------------------------------------------+-+ +-+------------+--------------------------------------------------------------------+----------+-+ +-+-PAR-index--+----------------------------PAR-values------------------------------+-default--+-+ | | 1 | Not used | | | | | 2 | Not used | | | | | 3 | ZMIN Lowest Z value | ZMIN | | | | 4 | ZMAX Highest Z value | ZMAX | | | | 5 | 1000*IXMIN + IXMAX (Useful for ZOOM) | 1-NX | | | | | | | | +-+-----6------+-1000*IYMIN-+-IYMAX-(Useful-for-ZOOM)-------------------------------+----1-NY--+-+
Figure: Example of HPLTAB with ARR option
+-+-CHOPT-=-'CONT'-Contour-plot----------------------------------------------------------------+-+ +-+------------+--------------------------------------------------------------------+----------+-+ +-+-PAR-index--+----------------------------PAR-values------------------------------+-default--+-+ | | 1 | Nlevel (min=2 max=50) | 20. | | | | 2 | 0 use colour to distinguish contours. Line type used is 1. | 0. | | | | | 1 use line style to distinguish contours. | | | | | | 2 line style and colour are the same for all contours. | | | | | | 3 draw the contour with fill colored fill are. | | | | | | | | | | | 3 | XMIN Lowest X-axis label | IXMIN | | | | 4 | XMAX Highest Y-axis label | IXMAX | | | | 5 | YMIN Lowest Y-axis label | IYMIN | | | | 6 | YMAX Highest Y-axis label | IYMAX | | | | 7 | ZMIN Lowest Z value | ZMIN | | | | 8 | ZMAX Highest Z value | ZMAX | | | | | | | | | | 9 | 1000*IXMIN + IXMAX (Useful for ZOOM) | 1-NX | | +-+----10------+-1000*IYMIN-+-IYMAX-(Useful-for-ZOOM)-------------------------------+----1-NY--+-+
Figure: Example of HPLTAB with CONT option
+-+--------------------------------------------------------------------------------------------+-+ +-+-CHOPT-=-'COL'-COLour-plot-------------------------------------------------------+----------+-+ +-+-PAR-index--+----------------------------PAR-values------------------------------+-default--+-+ | | 1 | 0 use the standard 8 colours | 0. | | | | 2 | Not used | | | | | 3 | ZMIN Lowest Z value | ZMIN | | | | 4 | ZMAX Highest Z value | ZMAX | | | | | | | | | | 5 | 1000*IXMIN + IXMAX (Useful for ZOOM) | 1-NX | | +-+-----6------+-1000*IYMIN-+-IYMAX-(Useful-for-ZOOM)-------------------------------+----1-NY--+-+
Figure: Example of HPLTAB with COL option
+-+-CHOPT-=-'TEXT'-Table-(Text)----------------------------------------------------------------+-+ +-+------------+--------------------------------------------------------------------+----------+-+ +-+-PAR-index--+----------------------------PAR-values------------------------------+-default--+-+ | | 1 | Text font | 1. | | | | 2 | Text Precision | 0. | | | | 3 | ZMIN Lowest Z value | ZMIN | | | | 4 | ZMAX Highest Z value | ZMAX | | | | 5 | 1000*IXMIN + IXMAX (Useful for ZOOM) | 1-NX | | | | | | | | +-+-----6------+-1000*IYMIN-+-IYMAX-(Useful-for-ZOOM)-------------------------------+----1-NY--+-+
Figure: Example of HPLTAB with TEXT option
+-+-CHOPT-=-'CHAR'-Character,-the-contains-is-one-single-character-----------------------------+-+ +-+------------+--------------------------------------------------------------------+----------+-+ +-+-PAR-index--+----------------------------PAR-values------------------------------+-default--+-+ | | 1 | Text font | 1. | | | | 2 | Text Precision | 0. | | | | 3 | ZMIN Lowest Z value | ZMIN | | | | 4 | ZMAX Highest Z value | ZMAX | | | | 5 | 1000*IXMIN + IXMAX (Useful for ZOOM) | 1-NX | | | | | | | | +-+-----6------+-1000*IYMIN-+-IYMAX-(Useful-for-ZOOM)-------------------------------+----1-NY--+-+
Figure: Example of HPLTAB with CHAR option
+-+-CHOPT-=-'LEGO'-Lego-(mode-0)---------------------------------------------------------------+-+ | | | | | | CHOPT = 'LEGO1' Lego with colours (mode 1) | | +-+-CHOPT-=-'LEGO2'-Lego-with-colours-(mode-2)-------------------------------------------------+-+ | | CHOPT = 'SURF' Surface (mode 0) | | | | CHOPT = 'SURF1' Surface with colours (mode 1) | | | | CHOPT = 'SURF2' Surface with colours (mode 2) | | | | CHOPT = 'SURF3' Surface with contour plot on top (mode 3) | | | | | | +-+-CHOPT-=-'SURF4'-Surface-with-Gouraud-shading-(mode-4)--------------------------------------+-+ | | CHOPT = 'CYL' Cylindrical for lego and surface | | | | CHOPT = 'SPH' Spherical for lego and surface | | +-+-CHOPT-=-'PSD'-Pseudo-rapidity-for-lego-and-surface------------------------------+----------+-+ | | PAR index | PAR values | default | | +-+-----1------+-Theta--------------------------------------------------------------+-----30.--+-+ | | | | | | | | 2 | Phi | 30. | | | | 3 | ZMIN Lowest Z value | ZMIN | | | | 4 | ZMAX Highest Z value | ZMAX | | | | 5 | 1000*IXMIN + IXMAX (Useful for ZOOM) | 1-NX | | | | 6 | 1000*IYMIN + IYMAX (Useful for ZOOM) | 1-NY | | +-+------------+--------------------------------------------------------------------+----------+-+
Figure: Example of HPLTAB with LEGO option
Figure: Example of HPLTAB with LEGO1 option
Figure: Example of HPLTAB with LEGO2 option
Figure: Example of HPLTAB with SURF option
Figure: Example of HPLTAB with SURF1 option
Figure: Example of HPLTAB with SURF2 option
Figure: Example of HPLTAB with SURF3 option
Figure: Example of HPLTAB with SURF4 option
Figure: Example of HPLTAB with LEGOPOL option
Figure: Example of HPLTAB with LEGOCYL option
Figure: Example of HPLTAB with LEGOSPH option
Figure: Example of HPLTAB with LEGOPSD option
Figure: Example of HPLTAB with SURFPOL option
Figure: Example of HPLTAB with SURFCYL option
Figure: Example of HPLTAB with SURFSPH option
Figure: Example of HPLTAB with SURFPSD option
+--------------------+
|CALL HPLTIT (CHTIT) |
+--------------------+
Action: Writes a title for a histogram instead of the HBOOK title. The
user must also turn off the option for printing the HBOOK title by setting
the option 'UTIT'.
Parameter Description:
+------------------------------+
|CALL HPLUSR (ID, CHCASE, KID) |
+------------------------------+
Action: This is an HPLOT User Routine. The user should not call it, but
provide his own subroutine HPLUSR, which will be called after each
histogram has been plotted. To avoid problems with unresolved external
references, a dummy routine HPLUSR is provided in the HPLOT library.
Parameter Description:
Using HPLUSR to have identical axes titles
SUBROUTINE HPLUSR(ID,CHCASE,KID)
CALL HPLAX('Momentum (GeV/c)','Time of flight(nsec)')
END
CALL HPLZON(2,2,1,' ')
CALL HPLOT(0,' ',' ',0)
Suppose also that for every histogram a comment must be written in the
lower left hand corner (i.e. zone number 3 in our example):
+--------+--------+ +--------+--------+ +---3----+--------+
SUBROUTINE HPLUSR(ID,CHCASE,KID)
CHARACTER*(*) CHCASE
DATA IWIN /0/
IWIN=IWIN+1
K=MOD(IWIN,4)
.
IF(K.EQ.3) CALL HPLCOM(......)
END
If the comment has to appear in the histogram box, HPLGIV could be used to
return the coordinates of the histogram box.
+----------------------------------------+
| CALL HPLWIR (CHOPT,XVAL, YVAL, CHTICK) |
+----------------------------------------+
Action: Draws ``cross-wires'' on a picture, optionally with tick marks and
values. In the present context cross-wires are lines perpendicular to the
X and/or Y axis.
Parameter Description:
CALL HPLWIR('YA',0.,3.14,'TICK')
CALL HPLWIR('Y' ,0.,3.14,' ')
In each case only one cross-wire will be drawn.
+------------------------------------+
|CALL HPLZOM (ID, CHOPT, IMIN, IMAX) |
+------------------------------------+
Action: Plots a 1 dimensional histogram between two channel numbers.
Parameter Description:
+------------------------------------------+
|CALL HPLZON (NXZON, NYZON, IFIRST, CHOPT) |
+------------------------------------------+
Action: Splits the picture into smaller parts, called zones. A complete
histogram can be drawn in one of these zones.
Parameter Description:
CALL HPLZON(3,2,1,' ')
the zones are numbered as follows:
+---------+--------+---------+
| | | |
| 1 | 2 | 3 |
+---------+--------+---------+
| | | |
| 4 | 5 | 6 |
+---------+--------+---------+
CALL HPLZON(3,2,1,' ')
DO 10 I=101,110
10 CALL HPLOT(I,' ',' ',0)
gives:
+---------+--------+---------+ +---------+--------+---------+
| | | | | | | |
| 101 | 102 | 103 | | 107 | 108 | 109 |
+---------+--------+---------+ +---------+--------+---------+
| | | | | | | |
| 104 | 105 | 106 | | 110 | | |
+---------+--------+---------+ +---------+--------+---------+
and a further call to HPLOT will start plotting below histogram 108.
+--------+---------+
| | |
CALL HPLZON(2,2,2,' ') | | 100 |
CALL HPLOT(100,' ',' ',0) | | |
For example: CALL HPLZON(2,2,4,'S'will give: | 102 +---------+
CALL HPLOT(101,' ',' ',0) | | |
CALL HPLZON(2,1,1,'S') | | 101 |
CALL HPLOT(102,' ',' ',0) +--------+---------+
This example also illustrates how one can force a histogram into a
particular zone.
CALL HPLZON(1,1,1,' ')
The next HPLOT call will start on a new picture.
CALL HPLOT(ID,' ',' ',0)
will give several pictures if slices/bands/projections are present. The
above remarks must be read with this in mind.
Note that routine HPLZON must be called after HPLOPT if the options 'A3',
'A4', 'HORI' or 'VERT' are being requested and also after a call to HPLSET
which defines the margin.
The distance between zones can be redefined using routine HPLSET and its
options XWIN and YWIN.