-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
VIS: Fix DataFrame.plot() produces incorrect legend markers when plotting multiple series on the same axis #27808
VIS: Fix DataFrame.plot() produces incorrect legend markers when plotting multiple series on the same axis #27808
Conversation
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.
A test would be nice. Does the issue post have one?
@TomAugspurger thanks very much for your quick review! Just curious about what you mean by |
Ideally we would make a plot and verify that the legend labels and markers
are matched up. I can never remember the matplotlib API for that though.
…On Wed, Aug 7, 2019 at 4:16 PM Kaiqi Dong ***@***.***> wrote:
@TomAugspurger <https://github.com/TomAugspurger> thanks very much for
your quick review! Just curious about what you mean by Does the issue
post have one? this issue does provide a fail case, but no test is given.
I do see some tests for plotting, but since this failure is mainly caused
by missing markers in legend, haven't found a proper solution to test if
this marker/color is printed correctly. Would be very nice if you could
give some hint! ^^
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27808?email_source=notifications&email_token=AAKAOITMP33G25W33WD6V2TQDM3STA5CNFSM4IKD3SXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3ZXOFA#issuecomment-519272212>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOITIAQNWQETQ7ESO74LQDM3STANCNFSM4IKD3SXA>
.
|
Thanks for your quick reply, I will check it up @TomAugspurger |
Hello @charlesdong1991! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-08-14 20:47:39 UTC |
This is kind of new working solution with a test case that is passing all tests on my local computer, not sure if it can also pass all tests here. But in the meantime pls feel free to take a look and provide reviews if you have some time. @TomAugspurger |
any follow-up reviews? all are much appreciated! ^^ |
Looks good. I'll restart the windows azure CI failure. |
ping |
Thanks! |
If you need another example of this problem let me know |
I found out that the reason this happens is because
subplots
is not updated accordingly whenplt.subplots()
is used and assign toax
, e.g.fig, ax = plt.subplots(nrows=1, ncols=3)
. I tested my solution and things all get solved, and figure looks very correct like below:BTW, i am not very sure how to properly test this, and would be nice to know!
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff