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

AnnotationBbox errors with kwargs #18942

Closed
Milestone
@alexiscoutinho

Description

@alexiscoutinho

Bug report

Bug summary

AnnotationBbox fails to initialize when kwargs, likezorder, are passed.

Code for reproduction

frommatplotlib.cbookimportget_sample_datafrommatplotlib.imageimportimreadfrommatplotlib.offsetboximportOffsetImage,AnnotationBboximage=imread(get_sample_data("ada.png"))im=OffsetImage(image)ab=AnnotationBbox(im, (0,0),zorder=2.9)

Actual outcome

TypeError                                 Traceback (most recent call last)<ipython-input-1-60e110e3dc44> in <module>      5 image = imread(get_sample_data("ada.png"))      6 im = OffsetImage(image)----> 7 ab = AnnotationBbox(im, (0, 0), zorder=2.9)~\AppData\Roaming\Python\Python38\site-packages\matplotlib\offsetbox.py in __init__(self, offsetbox, xy, xybox, xycoords, boxcoords, frameon, pad, annotation_clip, box_alignment, bboxprops, arrowprops, fontsize, **kwargs)   1447         """   1448 -> 1449         martist.Artist.__init__(self, **kwargs)   1450         mtext._AnnotationBase.__init__(self,   1451                                        xy,TypeError: __init__() got an unexpected keyword argument 'zorder'

Note that theArtist Init signature is just__init__(self).

Expected outcome

That such property is set as ifset_zorder was used instead, specially because the Init docstring says this about**kwargs: Other parameters are identical to.Annotation.

Matplotlib version

  • Operating system: Windows 10
  • Matplotlib version: 3.3.2
  • Matplotlib backend: module://ipykernel.pylab.backend_inline
  • Python version: 3.8.1

Don't know how Python was installed (using an university machine). Matplotlib installed via pip.

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp