JAIDA histograms using fixed bins
Code: "histo1_jaida.py". Programming language: Python
DMelt Version 1. Last modified: 12/12/2015. License: Pro
https://datamelt.org/code/cache/histo1_jaida_1578.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
from hep.aida.ref.histogram import Histogram1D,FixedAxis
from java.util import Random
from jhplot import H1D,HPlot
### your program here
# make JAIDA histograms
xAx = FixedAxis(30, -2.0, 2.0);
h1 = Histogram1D("JAIDA histogram","JAIDA histogram", xAx )
rand = Random()
for i in range(300):
h1.fill(rand.nextGaussian())
# plot it
c1 = HPlot("Canvas",600,400,1, 1)
c1.setGrid(0,0)
c1.setGrid(1,0)
c1.visible(1)
c1.setAutoRange()
hh=H1D(h1)
hh.setFill(1)
c1.draw(hh)
# export to some image (png,eps,pdf,jpeg...)
# c1.export(Editor.DocMasterName()+".png");
You see the box below because you did not login.