Ubuntu

subsequent figures close immediately

Reported by Matt Hickford on 2009-01-04
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
matplotlib (Ubuntu)
Low
Unassigned

Bug Description

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)
 pylab.show()

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)
> pylab.show()
>
> It should show a figure.

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

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

This is because pylab.show() 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.

HTH,
--
Sandro Tosi (aka morph, Morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

Benjamin Drung (bdrung) wrote :

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

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

matplotlib 0.98.5.3-1ubuntu1 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
python-matplotlib:
  Installed: 0.99.3-1ubuntu2
  Candidate: 0.99.3-1ubuntu2
  Version table:
 *** 0.99.3-1ubuntu2 0
        500 http://archive.ubuntu.com/ubuntu/ natty/universe amd64 Packages
        100 /var/lib/dpkg/status

Jens (jens.timmerman) wrote :

workaround with gtkagg does work

using

import matplotlib
matplotlib.use('GTKAgg')
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.
> https://bugs.launchpad.net/bugs/313834
>
> Title:
> subsequent figures close immediately
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/matplotlib/+bug/313834/+subscriptions

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

Other bug subscribers

Bug attachments