Dynamically Generating a Graph in Python

HansWL HansWL at msn.com
Wed Oct 6 19:15:05 EDT 2004


John Hunter <jdhunter at ace.bsd.uchicago.edu> wrote 
> It would be interesting to know where this performance hit is coming
> from.  What happens if you set backend : TkAgg and interactive : True
> in your rc file, and then fire up a standard python shell
> 
> >>> from matplotlib.matlab import *
> >>> t = arange(0.01, 2.0, 0.01)
> >>> s = sin(2*pi*t)
> >>> figure(1)
> >>> plot(t,s)
> 
> In interactive mode, all the plotting commands are acted upon when
> they are issued, which should enable you to debug which of these
> commands, if any, causes the long delay.

Finally got sometime to try again. Seems most time was spent importing
(30 seconds). So in interactive mode, I imported once, then execfiled
your examples with import commented out. Now the figures came on
within seconds.



More information about the Python-list mailing list