PlotData

Introduction

An instance of PlotData holds 0 or more datapoints. In addition it stores the y-axis (0 or more), it's own min/max x or y and the shape, the mode, the pen and the brush in which the datapoints should be drawn.

Python Interface

A PlotData can be created via a Python interface. The following python code creates it.

d = gui.PlotData()

The PlotData instance d provides the following methods:

AddY(double)
add a datapoint at y
AddYW(double, double)
add a datapoint at y with an error specified
AddXY(double, double)
add a datapoint at x, y
AddXWYW(double, double, double, double)
add a datapoint at x, y with x and y error specified
Add...(... , list[])
all of the above provides the ability to at the end also provide a list of strings

Import/Export

A PlotData can be created from an import or exported from a PlotData.

d = gui.ImportPlotData("filename")
gui.ExportPlotData(d, "filename")

Examples

#gui.PlotData(mode, shape, axis) takes 3 arguments defaults to 0, 0, 0)
d = gui.PlotData(0, 1, 2)

#The following 2 lines will give exactly the same result
d.AddY(2.3)
d.AddXWYW(0.0, 0.0, 2.3, 0.0)

#Add a list of strings at the end
d.AddY(2.3, ["test", "2.3"])
d.AddXY(0.0, 2.3, ["this is a test",str(2.3)])

back to PlotView