ich möchte in einem Frame ein Diagramm plotten, sowie
noch ein paar Buttons etc. Evtl mit BoxSizer. Was muß
ich beachten, jedenfalls geht das nachfolgende nicht,
(Diagramm wird nur mini ganz links oben dargestellt :
Code: Alles auswählen
import wx
import wx.lib.plot as plot
########################################################################
class PFrame:
""""""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
l1 = [(90, 6370), (180, 6363), (270, 6386), (360, 6365), (450, 6364), (540, 6378), (630, 6372), (720, 6358), (810, 6360), (900, 6381), (990, 6367), (1080, 6374), (1170, 6381), (1260, 6370), (1350, 6360)]
ymin = min([x[1] for x in l1]) - 2
ymax = max([x[1] for x in l1]) + 2
xmin = l1[0][0] #index erstes
xmax = l1[-1][0] #index letzes
frm = wx.Frame(-1, 'line', size=(700, 400))
client = plot.PlotCanvas(frm)
line = plot.PolyLine(l1, legend='', colour='pink', width=1)
gc = plot.PlotGraphics([line]) #, 'Line Graph', 'X Axis', 'Y Axis')
client.Draw(gc, xAxis= (xmin, xmax), yAxis= (ymin, ymax))
frm.Show(True)
class MyApp(wx.App):
def OnInit(self):
frm1 = PFrame(None, -1, 'test')
frm1.Show(True)
frm1.Centre()
return True
app = MyApp(0)
app.MainLoop()
joh