plhist

plot histogram or stick plot

parametertypeunitsdescription
*x,*yfloat*uuarrays defining the histogram
nint--number of elements in the arrays
typeint--histogram type: BARS, ENVELOPE or STICKS
baselineint--if TRUE, a baseline is drawn
ybasefloatuuy-position of the baseline, if any
returns:void

Description

plhist plots a histogram using values in arrays x (position) and y (height). x must be in ascending order. If baseline is TRUE a baseline is drawn at y=ybase. type determines the histogram type and can have one of three predefined values: BARS, ENVELOPE and STICKS. See the example for further explanation.

Examples

n=4 plrdx n 1 2 4 5 plrdy n 3 4 2 1

plinit PS plhist  A4 50 50 "" ""
plaxes 0 0 6 5 30 30 "" "" "BARS base=1"
plrect 0 0 6 5
       plhist n BARS TRUE 1   plmvorg 8 0
plaxes 0 0 6 5 30 30 "" "" "ENVELOPE base=2.5"
plrect 0 0 6 5
       plhist n ENVELOPE TRUE 2.5 plmvorg 8 0
plaxes 0 0 6 5 30 30 "" "" "STICKS base=0"
plrect 0 0 6 5
       plhist n STICKS TRUE 0
plframe 5 3

plhist