subsequent figures close immediately

Bug #313834 reported by Earth on 2009-01-04
This bug affects 2 people
Affects Status Importance Assigned to Milestone
matplotlib (Ubuntu)

Bug Description

Run something like this

import pylab

for i in range(1,3):
 X = [1,2]
 Y = [i,2]

It should show a figure. When you close its window, a second figure will be plotted in a new window.

In intrepid: the second window closes immediately.
Should happen (happens on other platforms): the second window stays open.

On Sun, Jan 4, 2009 at 21:41, Matt H <email address hidden> wrote:
> Public bug reported:
> Run something like this
> #!/usr/bin/python
> import pylab
> for i in range(1,3):
> X = [1,2]
> Y = [i,2]
> pylab.plot(X,Y)
> It should show a figure.

if you want a single figure with 2 plots in it, then move
out ot for loop.

> When you close its window, a second figure will
> be plotted in a new window.

This is because displays the first image (the one with
diagonal line) and wait for you to close the popped-up window. Once
done, the loop goes into the second (and last) iteration, and show the
second plot in a different picture.

Sandro Tosi (aka morph, Morpheus, matrixhasu)
My website:
Me at Debian:

Benjamin Drung (bdrung) wrote :

With GTKAgg backend it works correct, but with TkAgg backend the second window closes immediately. matplotlib is still affected.

Changed in matplotlib:
status: New → Confirmed
Benjamin Drung (bdrung) wrote :

matplotlib is still affected.

Benjamin Drung (bdrung) on 2009-06-14
Changed in matplotlib (Ubuntu):
importance: Undecided → Low
status: Confirmed → Triaged
Jens (jens.timmerman) wrote :

I'm still having this bug in ubuntu natty beta...
jens@morpheus:~$ apt-cache policy python-matplotlib
  Installed: 0.99.3-1ubuntu2
  Candidate: 0.99.3-1ubuntu2
  Version table:
 *** 0.99.3-1ubuntu2 0
        500 natty/universe amd64 Packages
        100 /var/lib/dpkg/status

Jens (jens.timmerman) wrote :

workaround with gtkagg does work


import matplotlib
import matplotlib.pyplot as pylab

instead of import pylab makes it work

WeatherGod (ben-v-root) wrote :

Don't import matplotlib.pyplot as pylab. This will only serve to cause confusion as the pylab interface is different from the pyplot interface. You should only need to do the first two lines (and they should be before any other matplotlib imports).

In addition, because Natty *should* come with matplotlib v1.0.1 (fingers crossed), this bug should become irrelevant as the problem in TkAgg has long since been fixed.

Julian Taylor (jtaylor) on 2012-11-17
Changed in matplotlib (Ubuntu):
status: Triaged → Fix Released

Thanks Julian!

On 17 Nov 2012, at 13:51, Julian Taylor <email address hidden> wrote:

> ** Changed in: matplotlib (Ubuntu)
> Status: Triaged => Fix Released
> --
> You received this bug notification because you are subscribed to the bug
> report.
> Title:
> subsequent figures close immediately
> To manage notifications about this bug go to:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments