Skip to content
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

maint: use matplotlib.pyplot in examples instead of matplotlib.pylab #3144

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

neutrinoceros
Copy link
Member

@neutrinoceros neutrinoceros commented Mar 24, 2021

PR Summary

See https://matplotlib.org/2.0.2/faq/usage_faq.html#matplotlib-pyplot-and-pylab-how-are-they-related

pylab is a convenience module that bulk imports matplotlib.pyplot (for plotting) and numpy (for mathematics and working with arrays) in a single name space. Although many examples use pylab, it is no longer recommended.

TLDR:
matplotlib.pylab is a wrapper that contains matplotlib.pyplot and numpy. The reason it exists was to help people migrating from Matlab to Python, but its usage is discouraged, so I'm replacing it with direct calls to pyplot in our documentation and docstrings.

@neutrinoceros neutrinoceros added enhancement Making something better docs labels Mar 24, 2021
@matthewturk
Copy link
Member

matthewturk commented Mar 24, 2021 via email

@neutrinoceros
Copy link
Member Author

I discovered this using pydeps
sample output:
Screenshot 2021-03-24 at 17 42 01

@munkm munkm merged commit aad3cfa into yt-project:main Mar 24, 2021
@neutrinoceros neutrinoceros deleted the modern_pyplot branch March 24, 2021 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs enhancement Making something better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants