Skip to content

Two TKagg widows popping up - should be one #1212

Closed

Description

@pelson

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.

Activity

  1. pelson commented on Sep 7, 2012

    @pelson
    MemberAuthor

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

  2. pelson commented on Sep 7, 2012

    @pelson
    MemberAuthor

    @dmcdougall should probably have some visibility of this issue.

  3. dmcdougall commented on Sep 7, 2012

    @dmcdougall
    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.

  4. pelson commented on Sep 7, 2012

    @pelson
    MemberAuthor

    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.
    
  5. dmcdougall commented on Sep 7, 2012

    @dmcdougall
    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...

  6. dmcdougall commented on Sep 7, 2012

    @dmcdougall
    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?

  7. dmcdougall commented on Sep 7, 2012

    @dmcdougall
    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?

  8. pelson commented on Sep 7, 2012

    @pelson
    MemberAuthor

    @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.

  9. dmcdougall commented on Sep 7, 2012

    @dmcdougall
    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?

  10. added a commit that references this issue on Sep 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions