-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
example file for making a bar of pie chart #11865
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
@@ -0,0 +1,97 @@ | |||
""" | |||
========= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail to build because the =
must be the right length...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was parroting other examples. What is the correct length?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as the title (or longer I think is OK)
bar_height = sum([item.get_height() for item in ax2.patches]) | ||
|
||
# draw top connecting line | ||
x = r*np.cos(math.pi/180*theta2)+center[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use np.pi to save the math import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
falke8 will complain about the spacing here. r * np.cos(np.pi / 180 * theta2) + center[0]
. Yes, its arbitrary, but its a good to have a standard so code looks the same throughout. http://flake8.pycqa.org/en/latest/user/error-codes.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I made the changes. I ran flake8 and it didn't seem to care about the math formatting. Just an fyi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update on that, I think it checks for consistency: when there were no spaces in the math it was happy. Then when I put spaces around most mathematical operators it wanted them around all of them and was spitting out problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this. It looks like it'll be great. Looks like it'll take a couple of tries to pass the CI tests. Look under Travis CI for flake8 errors (or install flake8 and run flake8 examples/pie_and_polar_charts/bar_of_pie.py
. Note that to pass Flake8, you'll have to add an exception to .flake8
for E402 because this code has an import near the bottom. And look under the CI for the doc builds for errors and to make sure your example looks the way you'd like.
Please use a more descriptive title, and a bit of description in the PR description.
Thanks again!
I'm not sure why this is failing the Travis CI. Anyone have any ideas? It is passing flake8 on my computer except for the E402 exception. |
You need to add the exception in Otherwise looks good. |
Okay, thanks. I didn't pick up on that earlier. |
.flake8
Outdated
@@ -6,6 +6,7 @@ ignore = | |||
E111, E114, E115, E116, E122, E124, E125, E127, E128, E129, E131, | |||
E265, E266, | |||
E305, E306, | |||
E402, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not here - add a per-file exception. See the other example files below...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. Approve conditional on CI passing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Anyone can merge after CI pass. Maybe the commits should be squashed.
@pjk645 one more chore and then you'll have done it all.. First, back your branch up ( Run
Your editor should open and you "pick" the first commit and "squash" the following five entries. Save that file, and then the editor will open again and you can edit the single commit message. Then |
Hopefully, I did that correctly... Thanks for the guidance |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
Thanks a lot for your patience with the process @pjk645 and congrats on your first contribution! |
OK, I don't feel this is so urgent as to go through the backport rigamarole. Undoubtably just |
PR Summary
PR Checklist