-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
update set_drawstyle #10340
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
update set_drawstyle #10340
Conversation
Invalidate path on set_drawstyle to recache path, such that the new drawstyle is actually applied. Fixes matplotlib#10338
This works for me. Can you add a test? https://matplotlib.org/devel/testing.html I guess this needs an image test, but can you remember to set |
I guess a test could look like this, just checking if the path has indeed been updated.
Where exactly would I add this test? I can't find a matplotlib/test directory on my fork. |
|
Add a test for setting drawstyle after line creation
Ok, found it. Thanks. |
lib/matplotlib/tests/test_lines.py
Outdated
assert len(line.get_path().vertices) == 2*len(x)-1 | ||
|
||
line.set_drawstyle("default") | ||
assert len(line.get_path().vertices) == len(x) | ||
|
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.
PEP8 will complain you need an extra line here (and maybe some other things above - I'm terrible at PEP8. But once this passes it looks good to me. Thanks!
Add a test for setting drawstyle after line creation, remove whitespaces to satisfy the PEP gods.
This isn't really urgent for 2.2, but is small enough that it should be quick to review |
was going to abstain given that I basiclaly posted the patch, but I guess @ImportanceOfBeingErnest also likes it so... |
Invalidate path on set_drawstyle to recache path, such that the new drawstyle is actually applied.
Fixes #10338
PR Summary
PR Checklist