From: Perry G. <pe...@st...> - 2004-12-11 02:06:36
|
John Hunter wrote: > Plots of this size should be extremely fast - you should be able to > plot arrays 10 times this big with good performance. From your > description "It does first draw a default plot ..and then overplot on > it for each subplot." it sounds like you may have interactive mode > turned on. This would kill your performance in a case like this, > because the entire figure would be redrawn with the update of every > single plotting command. See > http://matplotlib.sourceforge.net/interactive.html and > http://matplotlib.sourceforge.net/faq.html#SHOW . > > To definitively determine what mode you are in, run your script with > > > python simple_plot.py --verbose-helpful > > and verify that 'interactive is False'. Fernando Perez's ipython has > support for running scripts from the interactive shell, turning off > interactive mode for the duration of the run, and then restoring it. > I wondered the same thing and mentioned that to him privately (in effect you are doing n*(n-1)/2 plots instead of n). But that made me wonder whether or not there was a need for some sort of switch that delayed any update for just this case where one is looping over many plots (say you wrote a ploting function that did this that you want to run in interactive mode, and you wanted to use basic plotting functions like plot). Is there a simple mechanism to turn off interactive mode temporarily within the function and restore it at the end? If not, could it be added? (akin to the hold() function) Perry |