from paida import * analysisFactory = IAnalysisFactory.create() treeFactory = analysisFactory.createTreeFactory() tree = treeFactory.create() ### Creating dataPointSets. dataPointSetFactory = analysisFactory.createDataPointSetFactory(tree) dataPointSet = dataPointSetFactory.create('dataPointSet', '2D DataPointSet', 2) ### Filling. import random r = random.Random() for i in range(20): dataPoint = dataPointSet.addPoint() dataPoint.coordinate(0).setValue(i) dataPoint.coordinate(0).setErrorPlus(r.random() * 3.0) dataPoint.coordinate(0).setErrorMinus(r.random() * 3.0) dataPoint.coordinate(1).setValue(i + r.gauss(1.0, 1.0)) dataPoint.coordinate(1).setErrorPlus(r.random() * 3.0) dataPoint.coordinate(1).setErrorMinus(r.random() * 3.0) ### Plotting the histogram. plotterFactory = analysisFactory.createPlotterFactory() plotter = plotterFactory.create('PAIDA Plotter') region = plotter.createRegion(0.02, 0.02, 0.38, 0.96) region.setTitle('scatter format') region.style().setParameter('showTitle', 'true') region.style().dataStyle().setParameter('showErrorBars', 'True') region.style().dataStyle().setParameter('dataPointSet2DFormat', 'scatter') region.plot(dataPointSet) region = plotter.createRegion(0.42, 0.02, 0.56, 0.47) region.setTitle('scatterIndexed format') region.style().setParameter('showTitle', 'true') region.style().dataStyle().setParameter('showErrorBars', 'True') region.style().dataStyle().setParameter('dataPointSet2DFormat', 'scatterIndexed') region.plot(dataPointSet) region = plotter.createRegion(0.42, 0.51, 0.56, 0.47) region.setTitle('scatterColorIndexed format') region.style().setParameter('showTitle', 'true') region.style().dataStyle().setParameter('showErrorBars', 'True') region.style().dataStyle().setParameter('dataPointSet2DFormat', 'scatterColorIndexed') region.plot(dataPointSet) ### Wait. dummy = raw_input('Hit any key.')