 |
How to fill a profile histogram HProf1D
Source code name: "histo_prof1d.py"
Programming language: Python
Topic: Histograms/Profile
DMelt Version 1. Last modified: 12/11/2015. License: Pro
https://datamelt.org/code/cache/histo_prof1d_7947.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 jhplot import *
from java.util import Random
c1 = HPlot("Canvas")
c1.setGTitle("Profile histogram")
c1.setRange(0,11,1.5,2.5)
c1.setNameX("X")
c1.setNameY("Gaussian mean")
c1.visible()
h2=HProf1D("Profile1D",10,0.0, 11.0)
r=Random()
for i in range(2000):
h2.fill(10*r.nextDouble(),r.nextGaussian()+2)
h1=h2.getH1D()
h1.setStyle('p')
c1.draw(h1)
# export to some image (png,eps,pdf,jpeg...)
# c1.export(Editor.DocMasterName()+".png")
You see the box below because you did not login.