i have problem with this code:

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)

why plot is so small? i am new in Wx...


thanks

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()

this is a little example.. In the window must be graph and several buttons, but graph is too small:(
Thanks for all post

it doesnt work.
code:

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()

and i get error:

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'
This question has already been answered. Start a new discussion instead.