MVLib - Short Writeup - Version 4.0 Example Number 19 - Histogram booking and plotting |
This simple example shows how to book and plot an histogram,
the calls to mvbook allow to define an histogram, the calls
to mvbookfill fille the histogram data structure defined by
MVLIb and mvbookplot plot the histograms that can be composed in
variety of way. The use of MVLib parameters
The source code to produce these plots is available here and the complete script running the code is available here. |
|||||||
| ||||||||
nbin=40 call mvbook(10,0.0,1.0,nbin,' Test numero 1') call mvbook(20,0.0,1.0,nbin,' Test numero 2') call mvbook(30,0.0,1.0,nbin,' Test numero 3') do i=1,10000 call mvbookfill(10,gauss(0.5,0.2),1.0) if (mod(i,2).eq.0) call mvbookfill(20,gauss(0.5,0.2),1.0) if (mod(i,3).eq.0) call mvbookfill(30,gauss(0.5,0.2),1.0) enddo call mvsetflags('X size',1000.0) call mvsetflags('palette di colori',8.0) call mvsetflags('histogram statistic',0.0) call mvsetflags('histogram background',1.0) call mvsetflags('histogram color',6.0) call mvsetplotframe(0.00,0.50,0.45,0.90) call mvbookplot(10) call mvsetflags('histogram color',7.0) call mvsetplotframe(0.45,0.95,0.45,0.90) call mvbookplot(20) call mvsetflags('histogram color',3.0) call mvsetplotframe(0.00,0.50,0.00,0.45) call mvbookplot(30) call mvsetplotframe(0.45,0.95,0.10,0.50) call mvsetflags('histogram color',6.0) call mvsetflags('histogram background',4.0) call mvbookplot(10) call mvsetplotframe(0.45,0.95,0.05,0.45) call mvsetflags('histogram color',7.0) call mvbookplot(20) call mvsetplotframe(0.45,0.95,0.00,0.40) call mvsetflags('histogram background',3.0) call mvsetflags('histogram color',3.0) call mvbookplot(30) call displayexample('example19','MVBook subpackage','example19') end |