matplotlib icon indicating copy to clipboard operation
matplotlib copied to clipboard

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

Open pedrotnascimento opened this issue 9 years ago • 3 comments

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 https://github.com/matplotlib/matplotlib/issues/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

pedrotnascimento avatar Aug 06 '17 17:08 pedrotnascimento

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

dstansby avatar Aug 06 '17 17:08 dstansby

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)

pedrotnascimento avatar Aug 06 '17 17:08 pedrotnascimento

Correct, rotatelabels was implemented in https://github.com/matplotlib/matplotlib/pull/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.

tacaswell avatar Aug 06 '17 18:08 tacaswell