Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two TKagg widows popping up - should be one #1212

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

Two TKagg widows popping up - should be one #1212

pelson opened this issue Sep 7, 2012 · 9 comments
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone

Comments

@pelson
Copy link
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
Copy link
Member Author

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
Copy link
Member Author

pelson commented Sep 7, 2012

@dmcdougall should probably have some visibility of this issue.

@dmcdougall
Copy link
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
Copy link
Member Author

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
Copy link
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
Copy link
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
Copy link
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
Copy link
Member Author

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
Copy link
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

No branches or pull requests

3 participants