diff options
Diffstat (limited to 'thirdparty/cairoplot-trunk/trunk/gtktests.py')
-rwxr-xr-x | thirdparty/cairoplot-trunk/trunk/gtktests.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/thirdparty/cairoplot-trunk/trunk/gtktests.py b/thirdparty/cairoplot-trunk/trunk/gtktests.py new file mode 100755 index 0000000..5721260 --- /dev/null +++ b/thirdparty/cairoplot-trunk/trunk/gtktests.py @@ -0,0 +1,32 @@ + +import gtk +import cairoplot +from cairoplot.handlers.gtk import GTKHandler + +class CairoPlotWindow(gtk.Window): + """GtkWindow to display a plot.""" + + def __init__(self): + """Make a plot to test.""" + gtk.Window.__init__(self) + self.connect("destroy", gtk.main_quit) + + # make plot handler + handler = GTKHandler() + + # default data + data = [ (-2,10), (0,0), (0,15), (1,5), (2,0), (3,-10), (3,5) ] + plot = cairoplot.ScatterPlot(handler, data=data, + width=500, height=500, background="white", + border=20, axis=True, grid=True) + + handler.plot = plot + self.add(handler) + handler.show() + + +if __name__ == "__main__": + window = CairoPlotWindow() + window.show() + gtk.main() + |