An other way of drawing errors for 2D histograms


This example shows how to define a new histogram representation with a COMIS routine.

The routine derr.f

Subroutine Derr(Id) Character*80 Chtitl Real Errx(2) Real Erry(2) Real Errz(2) 1 Call Hgive(Id,Chtitl,Nx,Xmin,Xmax,Ny,Ymin,Ymax,Nwt,Idb) If (Ny.Eq.0) Return Zmin = Hcxy(1,1,1) Zmax = Zmin 2 Do i=1,Nx Do j=1,Ny Z = Hcxy(i,j,1) E = Hcxy(i,j,2) Ze1 = Z-E Ze2 = Z+E If (Ze1.Lt.Zmin) Zmin=Ze1 If (Ze1.Gt.Zmax) Zmax=Ze1 If (Ze2.Lt.Zmin) Zmin=Ze2 If (Ze2.Gt.Zmax) Zmax=Ze2 Enddo Enddo 3 Call Hplfr3(Xmin,Xmax,Ymin,Ymax,Zmin,Zmax,30.,30.,'FWB') Dx = (Xmax-Xmin)/Nx Dy = (Ymax-Ymin)/Ny X = Xmin+Dx/2. 4 Do i=1,Nx Y = Ymin+Dy/2. Do j=1,Ny Z = Hcxy(i,j,1) E = Hcxy(i,j,2) Errx(1) = X Errx(2) = Errx(1) Erry(1) = Y Erry(2) = Erry(1) Errz(1) = Z-E Errz(2) = Z+E Call Ipm3(1,X,Y,Z) Call Ipl3(2,Errx,Erry,Errz) Y = Y+Dy Enddo X = X+Dx Enddo End

How to use derr.f

hi/file 0 pawhists.hbook hrin * 5 SET MTYP 20 5 CALL DERR.F(200)

  1. Retrieve informations about the histogram.
  2. Loop over all the bins to find the minimum and the maximum taking care of the errors.
  3. Draw the 3D frame.
  4. Loop over all the bins and draw the error bars.
  5. Set the marker type and invoke the derr routine.



PAW TutorialLast update: 1999/04/01 14.58
Olivier.Couet@Cern.Ch