Data clouds shown as histograms (2D and density)
Code: "jaida_Cloud.py". Programming language: Python
DMelt Version 1. Last modified: 08/18/2016. License: Pro
https://datamelt.org/code/cache/jaida_Cloud_3842.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 import IAnalysisFactory
from java.util import Random
from hep.aida.ref.histogram import *
from jhplot import *
r = Random()
cl1D =Cloud1D( );
cl2D =Cloud2D( );
af = IAnalysisFactory.create();
tree = af.createTreeFactory().create();
hf = af.createHistogramFactory(tree);
r = Random()
cl1D = hf.createCloud1D( "cl1D", "1-Dimensional Cloud", 1500, "" )
cl2D = hf.createCloud2D( "cl2D", "2-Dimensional Cloud", 1500, "" )
for i in range(2000):
xval = r.nextGaussian();
yval = r.nextGaussian();
w = r.nextDouble();
cl1D.fill( xval, w );
cl2D.fill( xval, yval, w );
c1=HPlotter("Cloud",800,600,2,1)
c1.visible()
c1.cd(1,1)
c1.draw(cl1D)
c1.cd(2,1)
c1.draw(cl2D)
# c1.export("a.eps")
You see the box below because you did not login.