Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Show fails on figures created with the object-oriented system #1219

@jenshnielsen

Description

@jenshnielsen

The following code fails with a:

AttributeError: 'FigureCanvasTkAgg' object has no attribute 'manager'

On all all gui backends that I have tested. This seems to be because non of the canvases in any backends
have a manager attribute which is requested in the show method of the figure at line 348 in figure.py.

import matplotlib
matplotlib.use('gtkagg')
import matplotlib.backends as mbackends  # lazy import
from matplotlib.figure import Figure
fig = Figure()
ax = fig.add_subplot(1,1,1)
ax.plot(range(10))
fig.show()

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