FAQ
I am trying to plot a runtime graph using pylab. But the very purpose
of functionality is lost because of high CPU percentage hogged by
plotting the graph.

Here is the piece of code which I have written.

def timerfunc(ulcm, dlcm):
count=0
xaxis=[]
yaxis=[]
ion()
while 1:
xaxis.append(count)
dr=(((dlcm.sum)/dlcm.timer)*8)
dlcm.counter=0
yaxis.append(dr)
dlcm.sum=0
h=plot(xaxis,yaxis,'b')
draw()
count=count+1
time.sleep(dlcm.timer/1000.0)
if (count>100):
xlim(count-100, count)

Here is the function which plots the graph.

Is there something which does not makes sense .?

-Madhur

Search Discussions

  • David at Sep 5, 2010 at 10:48 am

    Il Sun, 5 Sep 2010 03:05:54 -0700 (PDT), Madhur ha scritto:


    Is there something which does not makes sense .?
    1. How, a computer, is supposed to handle your infinite loop?
    2. Running ghraphs shuold be handled in totally different way: look at the
    "stripcharting" demo in this zip
    http://agni.phys.iit.edu/~kmcivor/wxmpl/downloads/wxmpl-1.3.1.zip

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedSep 5, '10 at 10:05a
activeSep 5, '10 at 10:48a
posts2
users2
websitepython.org

2 users in discussion

Madhur: 1 post David: 1 post

People

Translate

site design / logo © 2022 Grokbase