wxPython + pyPlot

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert

    #1

    wxPython + pyPlot

    Hellow!

    I'm writing program with wxpython and pyplot.
    I need to put a graph (example):

    def _draw1Objects() :
    # 100 points sin function, plotted as green circles
    data1 = 2.*Numeric.pi*N umeric.arange(2 00)/200.
    data1.shape = (100, 2)
    data1[:,1] = Numeric.sin(dat a1[:,0])
    markers1 = PolyMarker(data 1, legend='Green Markers',
    colour='green', marker='circle' ,size=1)

    # 50 points cos function, plotted as red line
    data1 = 2.*Numeric.pi*N umeric.arange(1 00)/100.
    data1.shape = (50,2)
    data1[:,1] = Numeric.cos(dat a1[:,0])
    lines = PolyLine(data1, legend= 'Red Line', colour='red')

    # A few more points...
    pi = Numeric.pi
    markers2 = PolyMarker([(0., 0.), (pi/4., 1.), (pi/2, 0.),
    (3.*pi/4., -1)], legend='Cross Legend', colour='blue',
    marker='cross')

    return PlotGraphics([markers1, lines, markers2],"Graph
    Title", "X Axis", "Y Axis")


    on the PlotConvas object

    self.notebook1 = wx.Notebook(id= wxID_FRAME1NOTE BOOK1, name='notebook1 ',
    parent=self, pos=wx.Point(8, 24), size=wx.Size(80 0, 360),
    style=0)

    self.Okno_PT = wx.Window(id=wx ID_FRAME1Okno_P T, name='Okno_PT',
    parent=self.not ebook1, pos=wx.Point(0, 0),
    size=wx.Size(79 8,328), style=0)

    self.Wykres_PT = wx.lib.plot.Plo tCanvas(id=wxID _FRAME1WYKRES_P T,
    name=u'Wykres_P T', parent=self.Okn o_PT, pos=wx.Point(0, 0),
    size=wx.Size(51 0, 328), style=0)


    and I don't now how to do that.

    thanks for any help.
    Robert
  • Robert

    #2
    Re: wxPython + pyPlot

    Maebe, does anyone have some examples with wxPython and pyplot?

    Thanks again,
    Robert

    Comment

    • Philippe C. Martin

      #3
      Re: wxPython + pyPlot

      I think wxWidget comes with a sample

      Philippe

      Robert wrote:
      [color=blue]
      > Maebe, does anyone have some examples with wxPython and pyplot?
      >
      > Thanks again,
      > Robert[/color]

      Comment

      • Robert

        #4
        Re: wxPython + pyPlot

        Philippe C. Martin wrote:
        [color=blue]
        > I think wxWidget comes with a sample
        >
        > Philippe[/color]
        Yes I use it, but there is not a sample with pyplot.

        Robert

        Comment

        • Philippe C. Martin

          #5
          Re: wxPython + pyPlot

          My mistake, I understood plot (as in "from wx.lib.plot import *" that comes
          with wxwidgets and which does have a demo)

          Sorry,

          Philippe


          Robert wrote:
          [color=blue]
          > Philippe C. Martin wrote:
          >[color=green]
          >> I think wxWidget comes with a sample
          >>
          >> Philippe[/color]
          > Yes I use it, but there is not a sample with pyplot.
          >
          > Robert[/color]

          Comment

          Working...