Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
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
Labels
No labels