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
Handle argument "facecolors=None" correctly in plot_surface() #24727
Conversation
Thank you for your contribution @ocastany. Could you provide an example that demonstrates the problem you are fixing? |
Here is an example showing the problem before the patch:
|
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.
Could you add your example as a test so this doesn't come back again in the future?
Co-authored-by: Greg Lucas <greg.m.lucas@gmail.com>
Sorry, I don't know where and how to "add my example as a test". |
Hi @ocastany - you can look at the test_axes3d.py file and add your example as a test that needs to pass. You can also look at https://matplotlib.org/stable/devel/testing.html for more details on writing and verifying tests for Matplotlib. Cheers! |
I added a test function in my GitHub repository. Can you use it? |
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.
Yep, I can see your test and it looks good! Just a minor suggestion that we can do an image comparison that the facecolors=None
explicit argument should do the same thing as the default. We have a test decorator to help with that which I've added as a suggestion.
Co-authored-by: Greg Lucas <greg.m.lucas@gmail.com>
This looks good to me |
pre-commit.ci autofix |
Sorry @ocastany, it looks like the suggestions I had added additional white-space on some lines. precommit.ci can't autofix these because the PR is from your protected branch, so I suggested some additional changes to remove that which you will have to commit to your own branch. |
Co-authored-by: Greg Lucas <greg.m.lucas@gmail.com>
Co-authored-by: Greg Lucas <greg.m.lucas@gmail.com>
Thanks, @ocastany! |
PR Summary
Handle
plot_surface(facecolors=None)
correctly.This patch avoids the error:
UnboundLocalError: local variable 'color' referenced before assignment
.PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst