Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Draw not caching with macosx backend #7550

Closed
Milestone
@matthew-brett

Description

@matthew-brett

Using local install of current git master - the following code works with the tkagg backend, but raises an error with the macosx backend:

import matplotlibmatplotlib.use('macosx')import matplotlib.pyplot as pltfig, ax = plt.subplots(1, 1)im = plt.imshow([[1, 2], [3, 4]])fig.canvas.draw()ax.draw_artist(im)

Error for macosx backend is:

Traceback (most recent call last):  File "draw_artist.py", line 8, in <module>    ax.draw_artist(im)  File "/Users/mb312/dev_trees/matplotlib/lib/matplotlib/axes/_base.py",line 2423, in draw_artist    raise AttributeError(msg)AttributeError: draw_artist can only be used after an initial drawwhich caches the render

It seems to me that the previous callfig.canvas.draw() is the "initial draw" that should cache the renderer. So, is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp