Example of a plot using Jaida
Code: "jaida_PlotExample.java". Programming language: Java
DMelt Version 2.2. Last modified: 05/05/2015. License: Pro
https://datamelt.org/code/cache/jaida_PlotExample_7491.java
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.
import hep.aida.*;
import java.util.Random;
public class jaida_PlotExample
{
public static void main(String[] argv)
{
IAnalysisFactory af = IAnalysisFactory.create();
IHistogramFactory hf = af.createHistogramFactory(af.createTreeFactory().create());
IHistogram2D h2d = hf.createHistogram2D("test 2d",50,-30,30,50,-3,3);
Random r = new Random();
for (int i=0; i<10000; i++)
{
h2d.fill(10*r.nextGaussian(),r.nextGaussian());
}
IPlotter plotter = af.createPlotterFactory().create("Plot");
plotter.destroyRegions();
plotter.createRegion(0,0,.66,1).plot(h2d);
plotter.createRegion(.66,0,.33,.5).plot(hf.projectionX("X Projection",h2d));
plotter.createRegion(.66,.5,.33,.5).plot(hf.projectionY("Y Projection",h2d));
plotter.show();
}
}
You see the box below because you did not login.