import wx
class Plot(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, 'Cross Section Editor', size=(590, 390))
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        panel = wx.Panel(self, -1)        
        self.btnPlot = wx.Button(panel, label="Plot Cross Section", pos=(440,240))
        self.Bind(wx.EVT_BUTTON, self.OnPlot, id = self.btnPlot.GetId())

    def OnPlot(self, event):
        dlg = LinePlot()
        self.Show(True)

class LinePlot(wx.Frame):
    def __init__(self):
        self.data = [(1,2), (2,3), (3,5), (4,6), (5,8), (6,8), (10,10)]
        frm = wx.Frame(self, -1, 'scatter', size=(600,450))
        client = plot.PlotCanvas(frm)
        line = plot.PolyLine(self.data, legend='', colour='pink', width=1)
        gc = plot.PlotGraphics([line], 'Line Graph', 'X Axis', 'Y Axis')
        client.Draw(gc,  xAxis= (0,15), yAxis= (0,15))
        frm.Show(True)

        self.btnOK = wx.Button(panel, label="OK", pos=(190, 355))
        self.Bind(wx.EVT_BUTTON, self.OnOK, id = self.btnOK.GetId())

    def onOK(self):
        self.Show(False)
