Skip to content

pyplot.pie doesn't have rotatelabels, but the code is in the repo. #8998

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

Closed
pedrotnascimento opened this issue Aug 6, 2017 · 3 comments
Closed

Comments

@pedrotnascimento
Copy link

Bug summary
pyplot.pie doesn't have rotatelabels, the code seems to be not include into release 2.0.2

In docs, it says, that there is the property:
http://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.pie.html

I checked the code in this repo and the rotatelabels is there
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes/_axes.py

The #2304 seems to say that this improvement was already done years ago.

Code for reproduction
But when I run the code below with the matplotlib from all 2.0.2 I've found....

>import matplotlib.pyplot as plt
>l= ['a','b','c']; d = [30,60,10]
>plt.pie(d, labels=l, rotatelabels=True)

Actual outcome

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: pie() got an unexpected keyword argument 'rotatelabels'

Expected outcome
I think that rotatelabels of pie chart is a nice thing, when you have a lot of properties and you want to show them all the labels overlaps themselves. rotating them would display clearer, I guess
I checked the source code from 2.0.2 release of this repo and there is no rotatelabels in there

Matplotlib version

  • python 3.4, matplotlib 2.0.2 windows10
  • installed from source and from pip
@dstansby
Copy link
Member

dstansby commented Aug 6, 2017

Huh, that works fine for me and the labels are rotated. Maybe you have an old matplotlib installation hanging around somewhere?

@pedrotnascimento
Copy link
Author

Oh very fast, no, I uninstalled and furthermore can you check this file:
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes/_axes.py

in the latest release:
https://github.com/matplotlib/matplotlib/releases/tag/v2.0.2

you will see that in repo the rotatelabels exists but not in the release(which I think that all others whl and pip is based from)

@tacaswell
Copy link
Member

Correct, rotatelabels was implemented in #8217 which is currently on the master branch, is not in the 2.0.x series, and will be included in the upcoming 2.1 release.

If you want this feature now please install from master.

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

3 participants