Hi,

     First, I want to thank those who responded to my question about "the plot module" yesterday.  I realize now that the question could have been vague.  There is a plot module, simply called "plot," that I am using, and I guess it is not a very widely circulated plotting utility.

    Anyway, I'm a little confused by the output that I get from the following code:

/*******************************************************************************************************/

from Tkinter import *
from tkSimpleDialog import *
import Pmw
import HP34401A
import plot
import time

class Application(Frame):

    def __init__(self,master=None):
        Frame.__init__(self,master)
        self.pack()
        self.graph = plot.plot(self)
        self.beginplotting()

    def beginplotting(self):
        x = []
        y = []
        i = 0
        fLastOutput = time.time()
        while 1:
            fTime = time.time()
            if((fTime-fLastOutput) >= 2):
                i += 1
                x.append(fTime)
                y.append(2*fTime)
                self.graph.addSet(x,y)
                fLastOutput = fTime
                if(i>=30):break

app = Application()
app.mainloop()

/*******************************************************************************************************/

This is supposed to plot a point every two seconds.  When it actually runs, it instead stores all the data points and then plots them after 30 data points have been taken.  I'm fairly certain that this is not due to the use of the plot class.  If I have the program instead write each time into a Tkinter Text widget, the same type of thing happens.  That is, the program stores all 30 times in memory and then dumps them into the Text widget at the end.  Since I have written the code so that it plots (or writes to the Text widget) every two seconds, I am confused as to why this is happening.

Shankar

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to