Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Description
Bug summary
The tight bounding box of aWedge
patch appears to be incorrect. I suspect this is HiDPI issue - multiplying x0/y0/width/height by 2 seems to result in the correct bounding box for me.
Code for reproduction
importmatplotlib.pyplotaspltfrommatplotlib.patchesimportRectangle,Wedgefig,ax=plt.subplots()wedge=Wedge(0.5,0.4,10,30)ax.add_patch(wedge)# Plot bounding boxrenderer=fig.canvas.get_renderer()bbox=wedge.get_tightbbox(renderer)rect=Rectangle((bbox.x0,bbox.y0),width=bbox.width,height=bbox.height,linewidth=72./fig.dpi,edgecolor="red",facecolor="none",transform=None)fig.add_artist(rect)plt.show()
Actual outcome
Expected outcome
Red bounding box bounds the blue wedge.
Additional information
No response
Operating system
macOS
Matplotlib Version
3.6.0.dev1023+gb0f7b8aaf8
Matplotlib Backend
Qt5Agg
Python version
3.9.7
Jupyter version
No response
Installation
git checkout