Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 1 commit into from
Sep 1, 2016

Conversation

phobson
Copy link
Member

@phobson phobson commented Aug 18, 2016

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.

@phobson phobson force-pushed the partial-update-pylab-examples branch from 5e275f7 to 97d6185 Compare August 18, 2016 23:39
@story645
Copy link
Member

I'd vote for import matplotlib.pyplot as plt only 'cause I've seen those little inconsistencies trip people up badly.

@phobson phobson force-pushed the partial-update-pylab-examples branch from 92a23cc to 0e98523 Compare August 19, 2016 00:55
@phobson
Copy link
Member Author

phobson commented Aug 19, 2016

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
Copy link
Member

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.

@QuLogic QuLogic added Documentation MEP: MEP12 gallery and examples improvements labels Aug 19, 2016
plot([1,2,3])
show()
import matplotlib.pyplot as plt
plt.plot([1,2,3])
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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

Copy link
Member Author

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.

phobson added a commit to phobson/matplotlib that referenced this pull request Aug 19, 2016
@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Aug 20, 2016
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([1,2,3])
fig.show()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plt.show() ?

@QuLogic
Copy link
Member

QuLogic commented Aug 30, 2016

Ping?

@phobson
Copy link
Member Author

phobson commented Aug 31, 2016

@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.
-p

@QuLogic
Copy link
Member

QuLogic commented Aug 31, 2016

Sure, go ahead.

@phobson phobson force-pushed the partial-update-pylab-examples branch from 97a608a to 3e25df7 Compare August 31, 2016 19:36
@QuLogic QuLogic merged commit 32eb2c5 into matplotlib:master Sep 1, 2016
QuLogic added a commit to QuLogic/matplotlib that referenced this pull request Sep 1, 2016
…examples

DOC: clearing out some instances of using pylab in the docs
@QuLogic QuLogic modified the milestones: 2.0 (style change major release), 2.0.1 (next bug fix release) Sep 1, 2016
@QuLogic
Copy link
Member

QuLogic commented Sep 1, 2016

Backported to v2.x as d5af573.

@phobson phobson deleted the partial-update-pylab-examples branch September 2, 2016 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation MEP: MEP12 gallery and examples improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants