from paida import IAnalysisFactory ### In AIDA system, an analysisFactory creates some treeFactories, ### and a treeFactory creates some trees. analysisFactory = IAnalysisFactory.create() treeFactory = analysisFactory.createTreeFactory() tree = treeFactory.create() ### The tree with zipped XML format and allowing to create new r/w mode file. #tree = treeFactory.create('exampleBasic.aida', 'xml', False, True, 'compress=yes') ### Creating a histogram. histogramFactory = analysisFactory.createHistogramFactory(tree) import time currentTuple = time.localtime(time.time()) hours = 7 edgeMin = time.mktime((currentTuple[0], currentTuple[1], currentTuple[2], currentTuple[3]- hours, 0, 0, 0, 0, 0)) edgeMax = time.mktime((currentTuple[0], currentTuple[1], currentTuple[2], currentTuple[3], 0, 0, 0, 0, 0)) h1d = histogramFactory.createHistogram1D('hour', 'Distribution by Hour', hours, edgeMin, edgeMax) ### Filling. anHour = 60.0 * 60 from math import e for i in range(8): h1d.fill(edgeMin + i * anHour, 100.0 * e**(1.0 / (i + 1.0))) ### Plotting the histogram. plotterFactory = analysisFactory.createPlotterFactory() plotter = plotterFactory.create('PAIDA Plotter') region = plotter.createRegion() region.setTitle('Time type axis') region.style().setParameter('showTitle', 'true') plotterStyle = region.style() plotterStyle.dataStyle().setParameter('histogram1DFormat', 'bar') plotterStyle.xAxisStyle().setParameter('type', 'time') region.plot(h1d) ### Wait. dummy = raw_input('Hit any key.')