pmw.blt graph question

K

Karin Lagesen

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.update() (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.nographs)
simfile = os.path.join(self.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_data)
Yvect = Pmw.Blt.Vector()
y_data = tuple([dat[1] for dat in numarray])
Yvect.set(y_data)
self.graph.line_create(name, xdata=Xvect, ydata=Yvect,
symbol='')

Anybody got any ideas?

TIA,

Karin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top