-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Allow to not draw the labels on pie chart #11806
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
Conversation
for consistency with other API it is relatively easy and desirable to be able to pass the `label` and call `legend()` after the fact; which will display the legend in a box in one of the corner. When doing so, having the label on each piece of pie does not make much sens (and may clobber the pie chart). Thus allow to use ``None`` as a value for ``labeldistance`` as a way to not draw them.
I'm having difficulties getting the image comparison test to pass (none of them pass on my machine), so I'd appreciate if SO could regen the image and push on the branch for me. |
It should be noted that |
A general question here: Can you explain a bit the envisionned difference between
and
which is proposed here? |
Sure...
Outputs:
AS I said in the PR description, you need to pass I'm happy to change the api. |
While not a fan of extra kwargs I think that’s preferable here. I’d never think to read the labelspacing description far enough to know that’s how you control whether the label is shown or not, so a new kwarg is more discoverable in my opinion. |
Ok, thanks. So given
previously you could do
or (but that's hacky and might cause problems with layout managers or the tight savefig(?))
With this PR:
All codes produce the same desired output. However introducing a new argument just for this purpose feels like a bit of overkill. I would argue that either you read the complete documentation or you need to stick with the current possible solution, no? |
Another annoyance is
With that reasoning we would never add features right ? :-) |
What I wanted to say is that the proposal with Concerning tests, would it maybe be possible to test this without image comparisson? Essentially you want to test if
|
Sure.
Sounds good to me one the desired API has been agreed upon.
Also possible negative values as positioning with negative value does not make much sens, up to you. |
So I wasn't strongly agains the API here - lets merge as is after the images are fixed. I'll try and do the images now... |
I'm also happy to work on that next saturday at JupyterCon sprint if anybody is around. |
OK, think I did that right - I pushed a working image to your directory. To set up my deve environment I do:
If I don't do the clean than the install doesn't do the local freetype and tests fail. |
- fix pep8 error
... ok, and I think I fixed the flake8 complaint... |
I tend to go for a separate However, I wouldn't insist on the separate argument if a majority is fine with adapting |
Thanks everyone! |
PR Summary
for consistency with other API it is relatively easy and desirable to be
able to pass the
labels
and calllegend()
; which will displaythe legend in a box in one of the corner.
When doing so, having the label on each piece of pie does not make much
sens (and may clobber the pie chart). Thus allow to use
None
as avalue for
labeldistance
as a way to not draw them.PR Checklist
Yes in docstring, not sure if full-example is really needed.