from paida import IAnalysisFactory analysisFactory = IAnalysisFactory.create() treeFactory = analysisFactory.createTreeFactory() tree = treeFactory.create() ### Creating histograms. histogramFactory = analysisFactory.createHistogramFactory(tree) ### Fixed bin width histogram. h2dF = histogramFactory.createHistogram2D('fixed', 'Fixed', 20, 0.0, 20.0, 20, 0.0, 20.0) ### Filling with gaussian. import random r = random.Random() for i in range(1000): h2dF.fill(r.gauss(10.0, 3.0), r.gauss(10.0, 3.0)) ### Plotting the histogram. plotterFactory = analysisFactory.createPlotterFactory() plotter = plotterFactory.create('PAIDA Plotter') plotter.createRegions(2, 2) plotter.region(0).setTitle('Bar format') plotter.region(0).style().setParameter('showTitle', 'true') plotter.region(0).style().dataStyle().setParameter('histogram2DFormat', 'bar') plotter.region(0).plot(h2dF) plotter.region(1).setTitle('Box format') plotter.region(1).style().setParameter('showTitle', 'true') plotter.region(1).style().dataStyle().setParameter('histogram2DFormat', 'box') plotter.region(1).plot(h2dF) plotter.region(2).setTitle('Ellipse format') plotter.region(2).style().setParameter('showTitle', 'true') plotter.region(2).style().dataStyle().setParameter('histogram2DFormat', 'ellipse') plotter.region(2).plot(h2dF) ### Wait. dummy = raw_input('Hit any key.')