| | |
Wx Plot
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Mar 2006
Posts: 56
Reputation:
Solved Threads: 1
i have problem with this code:
why plot is so small? i am new in Wx...
thanks
Python Syntax (Toggle Plain Text)
def __init__(self,parent): data = [(1,2), (2,3), (3,5), (4,6), (5,8), (6,8), (10,10)] self.okno=wx.Frame(None,title="Graf",id=-1) sizer=wx.BoxSizer(wx.HORIZONTAL) ram=wx.Panel(self.okno) client = plot.PlotCanvas(ram) line = plot.PolyLine(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)) sizer.Add(ram,1,0,wx.ALL) self.okno.SetSizer(sizer) self.okno.Layout() self.okno.Show(True)
thanks
•
•
Join Date: Mar 2006
Posts: 56
Reputation:
Solved Threads: 1
Python Syntax (Toggle Plain Text)
import wx import wx.lib.plot as plot class Example: def __init__(self): data = [(1,2), (2,3), (3,5), (4,6), (5,8), (6,8), (10,10)] self.okno=wx.Frame(None,title="Graf",id=-1) sizer=wx.BoxSizer(wx.VERTICAL) ram=wx.Panel(self.okno) client = plot.PlotCanvas(ram) line = plot.PolyLine(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)) sizer.Add(ram,1,0,wx.ALL) sizer.Add(wx.Button(self.okno,label="Button")) self.okno.SetSizer(sizer) self.okno.Layout() self.okno.Show(True) okno = wx.App(0) Example() okno.MainLoop()

Thanks for all post
•
•
Join Date: Mar 2006
Posts: 56
Reputation:
Solved Threads: 1
it doesnt work.
code:
and i get error:
code:
Python Syntax (Toggle Plain Text)
import wx,os import wx.lib.plot as plot class Example: def __init__(self): data = [(1,2), (2,3), (3,5), (4,6), (5,8), (6,8), (10,10)] self.okno=wx.Frame(None,title="Graf",id=-1) sizer=wx.BoxSizer(wx.VERTICAL) ram=wx.Panel(self.okno) client = plot.PlotCanvas(ram, size = (300, 350)) line = plot.PolyLine(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)) sizer.Add(ram,1,0,wx.ALL) sizer.Add(wx.Button(self.okno,label="Button")) self.okno.SetSizer(sizer) if os.path.exists("tips.txt"): wx.CallAfter(self.okno.ShowTip, wx.GetApp().GetTopWindow(), wx.CreateFileTipProvider("tips.txt", 0)) self.okno.Layout() self.okno.Show(True) okno = wx.App(0) Example() okno.MainLoop()
Python Syntax (Toggle Plain Text)
Traceback (most recent call last): File "C:\Documents and Settings\Blu\Plocha\aa.py", line 25, in -toplevel- Example() File "C:\Documents and Settings\Blu\Plocha\aa.py", line 12, in __init__ client = plot.PlotCanvas(ram, size = wx.Size(300, 350)) TypeError: __init__() got an unexpected keyword argument 'size'
![]() |
Similar Threads
- How do I plot a graph using C++? (C++)
- plot (C)
- Visual C++ and Excel (C++)
Other Threads in the Python Forum
- Previous Thread: Wx Unicode
- Next Thread: An isprime(n) function
| Thread Tools | Search this Thread |
Tag cloud for Python
abrupt ansi anti apache approximation array basic beginner book builtin calculator chmod code converter countpasswordentry curved dan08 dictionaries dictionary dynamic examples excel file filename float format ftp function gui heads homework import inches input java launcher library line lines linux list lists loop mouse mysql mysqlquery number numbers numeric output parsing path phonebook plugin port prime programming progressbar projects py2exe pygame pyqt pysimplewizard python random recursion recursive redirect refresh scrolledtext software ssh stamp statictext statistics string strings table terminal text textarea thread threading time tkinter tlapse trick tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable windows wordgame write wxpython






