Hello 

I am trying to use this application to plot a diagram from a log file that is 
always active and storing data. I have written the following and I have issues 
once I touch the figure window it freezes...

from pylab import *
import time
val = 1

while True:
    inData = load('c:\\data.txt')
    x = inData[:,0]
    y = inData[:,1]
    plot(x,y,'o')
    if val == 1:
        show()
    time.sleep(1)
    if val == 0:
        val = 0
    time.sleep(1)
    draw()

I am using the following program to create some dummy data:

import time
import math

def test():
    for i in range(900):
        for rad in sineVal:
            fileData = open('c:\\data.txt','a')
            time.sleep(1)  
            fileData.write('%d' % int(i))
            fileData.write('\t')
            fileData.write('%f' % math.sin(rad))
            fileData.write('\n')
            fileData.close()
            print('*'),

def makeArray():
    tempArray = []
    for i in range(0,360,180):
        tempArray.append(i)
    return tempArray

sineVal = makeArray()

test()

You help and suggestion in the above matter will be most welcomed.

BR /ray



       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to