Closing a pyplot window under MSWindows and under Linux

Dear all,

Consider the following short program:

from matplotlib.pyplot import title, show
for i in xrange(3):
    title(i+1)
    print "window No. "+str(i+1)+" was closed"
    show()

If I run it under Windows XP, at each show() the program displays a window and
blocks; if I close the window by clicking on the "X" at the top right corner,
the program prints the message "window No. ... was closed" , then opens a new
window, and so on for a total of three iterations.

If I run it under Linux (Ubuntu 9.10, living inside a Virtualbox machine),
everything works the same until I close the first window, after which no new
windows are ever opened and displayed. The program does not die, because all
three messages are sent to console:

window No. 1 was closed
window No. 2 was closed
window No. 3 was closed

My questions for the cognoscenti are:

1. Why this difference?
2. How can I get under Linux the same behaviour as under Windows?

Thanks in advance,

Enzo