Skip to content

Two TKagg widows popping up - should be one #1212

Closed
pelson opened this Issue Sep 7, 2012 · 9 comments

3 participants

@pelson
Matplotlib Developers member
pelson commented Sep 7, 2012

As a result of #1125 we now get two tk windows from the following code:

import matplotlib
matplotlib.use('tkagg')
import matplotlib.pyplot as plt

plt.plot(range(10))
plt.show()

I have commented where (and potentially how) I think the problem should be resolved.

@pelson
Matplotlib Developers member
pelson commented Sep 7, 2012

Marked as 1.2 release critical - we probably don't want 1.2 going out of the door without fixing this.

@pelson
Matplotlib Developers member
pelson commented Sep 7, 2012

@dmcdougall should probably have some visibility of this issue.

@dmcdougall
Matplotlib Developers member

Hmmmmmm. Pants. I'll look into it this evening. I reckon a simple:

if matplotlib.is_interactive():
    canvas = None
else:
    canvas = self._canvas_setup()

should work, unless I'm missing something.

@pelson
Matplotlib Developers member
pelson commented Sep 7, 2012

I don't think so. I'm not working in interactive mode here (unless I've missed the meaning of matplotlib.is_interactive).

@dmcdougall : To completely abuse its original meaning, I quote Martin Luther King, Jr. :

All progress is precarious, and the solution of one problem brings us 
face to face with another problem.
@dmcdougall
Matplotlib Developers member

Fitting :)

Ok. I suppose the question I'm trying to answer is, "How do I determine whether an interactive backend is currently loaded?"

Edit: Assuming, of course, that this behaviour also occurs with the GTK and Qt backends...

@dmcdougall
Matplotlib Developers member

I don't see the double window behaviour with either the qt4agg backend or the macosx backend. @pelson do you see this with either of these backends?

@dmcdougall
Matplotlib Developers member

@verbit Line 508 of lib/matplotlib/backends/backend_tkagg is

FigureCanvas = FigureCanvasTkAgg

so the return value of pylab_setup[0] does indeed have a FigureCanvas for this backend. Do you see this behaviour with qt4agg or gtkagg?

Perhaps this is actually a bug in the tkagg backend?

@pelson
Matplotlib Developers member
pelson commented Sep 7, 2012

@dmcdougall : I think @verbit is raising a completely different issue. I think its best we discuss this inline on the original PR rather than muddying the issue here.

@dmcdougall
Matplotlib Developers member

Ah right, these two issues are completely separate. Sorry, the timing of each of the issues threw me.

@pelson For some reason the tk backend crashes my entire ipython session, probably just using an outdated version or something. Do you see this behaviour with any of the other interactive backends?

@efiring efiring closed this Sep 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.