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

Appearance settings

[Bug]: Wedge tight bounding box incorrect #21931

Copy link
Copy link
Open
@dstansby

Description

@dstansby
Issue body actions

Bug summary

The tight bounding box of a Wedge 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

import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle, Wedge

fig, ax = plt.subplots()
wedge = Wedge(0.5, 0.4, 10, 30)
ax.add_patch(wedge)

# Plot bounding box
renderer = 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

Screenshot 2021-12-11 at 17 41 18

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.