-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: clearing out some instances of using pylab in the docs #6957
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
DOC: clearing out some instances of using pylab in the docs #6957
Conversation
5e275f7
to
97d6185
Compare
I'd vote for |
92a23cc
to
0e98523
Compare
good point @story645 non-beginners will already have an opinion about aliases and will be able to read/modify as they see fit. |
@@ -4,62 +4,68 @@ | |||
# Example boxplot code | |||
# | |||
|
|||
from pylab import * | |||
import numpy |
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.
import numpy as np
is the usual thing.
plot([1,2,3]) | ||
show() | ||
import matplotlib.pyplot as plt | ||
plt.plot([1,2,3]) |
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.
any good reason to not do:
fig, ax = plt.subplots()
ax.plot([1,2,3])
fig.show()
since it's only one more line?
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 prefer using subplots
too, but I figured the intro was intended to be hyper-brief.
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.
Meh, I feel like one more line + good practice is still hyper brief. shrugs
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 you're right. I'll change it.
import matplotlib.pyplot as plt | ||
fig, ax = plt.subplots() | ||
ax.plot([1,2,3]) | ||
fig.show() |
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.
plt.show()
?
Ping? |
@QuLogic took care of those last comments. let me know if you want me to squash/fixup the everything to a single commit. I'm comfortable with and happy to do that. |
Sure, go ahead. |
97a608a
to
3e25df7
Compare
…examples DOC: clearing out some instances of using pylab in the docs
Backported to |
Note: there are some instances where I
from matplotlib import pyplot
, since that's what I'm in the habit of doing now.Obviously I prefer it that way, but if I need to switch from
import matplotlib.pyplot as plt
, just let me know. I understand the inertial forces at work there.