pmw.blt graph question

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

    pmw.blt graph question

    I have a gui with a graph area built with Pmw and Pmw.Blt. Through this
    gui I calculate some values that I would like to display in the graph
    area. Now, this worked fine when I made the graph in the main gui-building
    process and just changed the Pmw.Blt.Vectors that I had used to make
    the graph with when I pressed 'compute' and thus activated the compute
    method.

    However, now I would like to just add graphs to the graph area. I.e.
    every time I run the compute method I would like to make a new graph
    and have it displayed with the existing ones in the graph area.
    This means having all the graph making stuff in the compute method.
    However, now the graph isn't being displayed. I do know it is somehow
    being connected with the graph area, since it is added to the legend
    area. I tried doing a self.master.upd ate() (where master is a Tk()
    object), this resulted in the graph briefly being flashed across the
    area before it vanished again.

    Here is the code I use to create the graphs:

    self.nographs += 1
    name = 'g' + str(self.nograp hs)
    simfile = os.path.join(se lf.p['case'].get(), 'sim.dat')
    simdata = open(simfile, 'r')
    numarray = filetable.read( simdata)
    Xvect = Pmw.Blt.Vector( )
    x_data = tuple([dat[0] for dat in numarray])
    Xvect.set(x_dat a)
    Yvect = Pmw.Blt.Vector( )
    y_data = tuple([dat[1] for dat in numarray])
    Yvect.set(y_dat a)
    self.graph.line _create(name, xdata=Xvect, ydata=Yvect,
    symbol='')

    Anybody got any ideas?

    TIA,

    Karin
    --
    Karin Lagesen,
    karin.lagesen@l abmed.uio.no
Working...