from paida import IAnalysisFactory analysisFactory = IAnalysisFactory.create() treeFactory = analysisFactory.createTreeFactory() tree = treeFactory.create() ### Creating histograms. histogramFactory = analysisFactory.createHistogramFactory(tree) h1d = histogramFactory.createHistogram1D('histogram', 'Histogram', 20, 0.0, 20.0) ### Filling with gaussian. import random r = random.Random() for i in range(1000): h1d.fill(r.gauss(10.0, 3.0)) ### Creating plotter. plotterFactory = analysisFactory.createPlotterFactory() plotter = plotterFactory.create('PAIDA Plotter') plotter.setParameter('landscape', 'False') region = plotter.createRegion() region.setTitle('Styles') ### Styles. plotterStyle = region.style() plotterStyle.setParameter('showTitle', 'True') plotterStyle.setParameter('showStatisticsBox', 'True') plotterStyle.setParameter('showLegendsBox', 'True') plotterStyle.setParameter('showTextsBox', 'True') dataStyle = plotterStyle.dataStyle() dataStyle.setParameter('showErrorBars', 'True') dataStyle.setParameter('errorBarsPoint', 'mean') dataStyle.setParameter('errorBarsColor', 'red') dataLineStyle = dataStyle.lineStyle() dataLineStyle.setColor('blue') dataFillStyle = dataStyle.fillStyle() dataFillStyle.setColor('yellow') xAxisStyle = plotterStyle.xAxisStyle() xAxisStyle.setLabel('points') xAxisStyle.setParameter('grid', 'true') yAxisStyle = plotterStyle.yAxisStyle() yAxisStyle.setLabel('persons') yAxisStyle.setParameter('scale', 'log') yAxisStyle.setParameter('grid', 'true') plotterLayout = region.layout() plotterLayout.setParameter('textsBoxAnchor', 'SE') titleStyle = plotterStyle.titleStyle() titleTextStyle = titleStyle.textStyle() titleTextStyle.setFontSize(18) titleTextStyle.setBold(True) ### Info. info = region.info() info.addLegend(dataLineStyle, 'Distribution') info.addText('This is texts box') info.addText('[some descriptions]') region.plot(h1d) ### Wait. dummy = raw_input('Hit any key.')