Tôi đang vẽ wxApp rất đơn giản.wxPython wx.lib.plot.PlotCanvas error
Tôi đã cài đặt Python 2.7.9 và 3.0.2 wxPython
Đây là mã của tôi:
import wx
import wx.lib.plot as plot
class Pantalla(wx.Frame):
def __init__(self):
app = wx.App()
self.frame1 = wx.Frame(None, title = "GRAFICADOR", id = -1, size=(500,500))
self.panel1 = wx.Panel(self.frame1)
self.panel1.SetBackgroundColour("white")
plotter = plot.PlotCanvas(self.panel1, id=-1, pos = wx.Point(-1,-1), size = wx.Size(-1,-1), style = 0, name= 'plotCanvas')
data = [(1,2), (2,3), (4,6)]
line = plot.PolyLine(data, colour='red', width = 1)
gc = plot.PlotGraphics([line], 'Line', 'Eje x', 'Eje y')
plotter.Draw(gc, xAxis = (0,15), yAxis=(0,15))
self.frame1.Show(True)
app.MainLoop()
t = Pantalla()
Tuy nhiên, bất cứ khi nào tôi thử nghiệm nó, nó ném cho tôi lỗi này:
Traceback (most recent call last):
File "<pyshell#26>", line 1, in <module>
f = Pantalla()
File "<pyshell#25>", line 7, in __init__
plotter = plot.PlotCanvas(self.panel1, id=-1, pos = wx.Point(-1,-1), size = wx.Size(-1,-1), style = 0, name= 'plotCanvas')
File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\lib\plot.py", line 598, in __init__
self.HandCursor = wx.Cursor(Hand.GetImage())
File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_gdi.py", line 1547, in __init__
_gdi_.Cursor_swiginit(self,_gdi_.new_Cursor(*args, **kwargs))
TypeError: Required argument 'type' (pos 2) not found
Tôi đang chuyển tất cả các tham số mà tài liệu của wx nói. Tôi đang làm gì sai?
Có vẻ như nó liên quan đến vé này: http://trac.wxwidgets.org/ticket/16767#no1 – akvallejos