Skip to content

AttributeError: 'FigureCanvasQTAgg' object has no attribute 'callbacks' #1184

Closed

Description

@mherman-nm

Calling pyplot.figure() multiple times causes a partial trace to appear in the terminal (partial because the entire chain of calls is not shown):

Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_qt4.py", line 156, in
lambda: self.close_event())
File "/usr/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 1564, in close_event
self.callbacks.process(s, event)
AttributeError: 'FigureCanvasQTAgg' object has no attribute 'callbacks'

This bug was reported on Nabble in May:

http://matplotlib.1069221.n5.nabble.com/Qt-close-bug-revisited-td35203.html

The first user to report this bug presented a simple bit of code for reproducing the bug:

import matplotlib.pyplot as plt
fig = plt.figure()
plt.plot([0, 1])
fig = plt.figure()
plt.plot([0, 1])

I am able to get the same error message using the same code.

python2-matplotlib 1.1.1-1
python2 2.7.3-2
archlinux 64 bit

-Mike

Activity

  1. efiring commented on Sep 1, 2012

    @efiring
    Member

    I was running into the same error upon quitting, so I suppressed it: #1098. Thank you for pointing out this method of triggering it, however, because it suggests that there may be a better way of handling it.

  2. tacaswell commented on Nov 27, 2013

    @tacaswell
    Member

    @mherman-nm Can you still reproduce this on a mac with a current version of mpl?

  3. tacaswell commented on Nov 26, 2014

    @tacaswell
    Member

    Closing this as it is 2+ years old and there is a work-around in the code.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions