-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
pyplot.style.use() to accept pathlib.Path objects as arguments #15149
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
pyplot.style.use() to accept pathlib.Path objects as arguments #15149
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.
I think this is a great start, but if we are going to take just a Path
then we also need to support List[Path]
.
There's also a context manager in the same file that basically wraps |
Thanks for working on this @omsitapara23 ! |
…dated code and comments according to reviews
Hi @tacaswell, and @QuLogic I have done all the requested changes.
Thank you |
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.
Please add a test in lib/matplotlib/tests/test_style.py
that Path
s works.
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.
Test can be simplified, but otherwise seems fine. Also, there are quite a few commits; they probably be squashed down a bit.
Co-Authored-By: Elliott Sales de Andrade <[email protected]>
Co-Authored-By: Elliott Sales de Andrade <[email protected]>
Mutliple paths are now supported.
@tacaswell Can we still bring this into 3.2? I think it's a nice addition. |
changed the comments according to numpydoc Co-Authored-By: Tim Hoffmann <[email protected]>
PR Summary
Currently the pyplot.style.use() supports strings, list, and dic as function arguments where string can be a library style or path/URL to style file. Added the code to leverage the function to use pathlib.Path object as an argument.
Fixes #15138
PR Checklist