Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Limit autoscaling doesn't take into account pie() labels #22057

Open
dstansby opened this issue Dec 28, 2021 · 1 comment
Open

[Bug]: Limit autoscaling doesn't take into account pie() labels #22057

dstansby opened this issue Dec 28, 2021 · 1 comment

Comments

@dstansby
Copy link
Member

Bug summary

Autoscaled axis limits don't take into account text labels added by Axes.pie().

Code for reproduction

import matplotlib.pyplot as plt
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
sizes = [15, 30, 45, 10]

plt.pie(sizes, labels=labels, labeldistance=1.5, frame=True)
plt.show()

Actual outcome

pie

Expected outcome

Text labels are taken into account when autoscaling the Axes, and limits are expanded to include the labels.

Additional information

No response

Operating system

No response

Matplotlib Version

3.6.0.dev1129+ga35921c407

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

git checkout

@oscargus
Copy link
Contributor

oscargus commented Jan 5, 2022

This may be obvious, but it seems like the Text objects are not taken into consideration for auto-scale. Maybe one would like to have a flag for the Text object that says if it should be taken into consideration or not? (As otherwise labels etc will be messed up?) This can probably be useful in other situations as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants