multiple plots in one script

Hello all

I used to work with python 2.2 and with that version I was able to make multiple plots in one script like the example below:

from pylab import *

x = arange(10)

plot(x, c = 'b')
print isinteractive()
show()

plot(x, c = 'r')
print isinteractive()
show()

plot(x[::-1], c = 'g')
print isinteractive()
show()

The script would stop running during the visualisation of the plot and continue after I manually closed the plotting window.

However, with the newest python (2.4.1) and matplotlib.pylab version 0.83.2, only the first window can be closed manually. Python then goes into interactive mode and all the plotting commands are plotted into one new window, which can not be accessed anymore by windows, the window hangs.

How can I make make multiple plots within one script using the newest python version?

thanks

Menno Straatsma

The short answer is:
give the fig() command before starting to create each plot,
and give only one show() command at the end.

However all plots will be displayed when you give the show
command. Like you, I used to use multiple show() commands
in order to get sequential (one at a time) display. I found
this useful in the classroom. I do not know how to do that
in pylab now.

Cheers,
Alan Isaac

ยทยทยท

On Thu, 25 Aug 2005, Menno Straatsma apparently wrote:

How can I make make multiple plots within one script using
the newest python version?