-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
updated the pyplot fill_between example to elucidate the premise;maki… #10967
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
Conversation
…ng the chart more readable and removing unnecessary confusing code
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.
Thanks for the PR! The title needs to change, and I disagree w removing sin; if someone looking at the code can’t guess what sin(x) does when x is an array, then.... use of alpha is great. Tests are failing on line length errors. Please keep under 80 characters long.
x = np.arange(0.0, 2, 0.01) | ||
y1 = np.sin(2*np.pi*x) | ||
y2 = 1.2*np.sin(4*np.pi*x) | ||
x = np.arange(-5, 5, 0.01) |
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.
Title still needs to be changed (this isn't your fault, but this name is just an error from the conversion to sphinx gallery).
I still think that np.sin
is just as useful an example as yours. not sure why you think this is more illustrative - is it just because you lose track of what is y1 and what is y2?
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.
fwiw I prefer the parabolas (because as you say it's easier to keep track of who's who).
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'll commit the name change
I'm not sure what I did to make the lgtm analysis fail. Any thoughts?
|
I don't care what the file is named. I care about the title that users see!
|
…o fillBetweenExampleBranch
This reverts commit f65ab08. reverting to the commit before the filename change since this broke the build
That "should" be correct now |
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.
👍 thanks for this, I think the modified example looks much better
…making the chart more readable and removing unnecessary confusing code
This example was changed to two opposing quadratic functions that are highlighted in red for their intersection area, and in yellow for the area between the curves. This example highlights the fill between example better than the previous example, two intersecting sin graphs, because it is very clear what is exactly "between" and "intersecting".
Additionally I removed confusing use of code that I believed distracted from the true purpose of the example: the illustrate the use of fill_between(). Previously to understand the example one had to understand that the nympy.sin() method could be used to generate an array. The updated example can be read more clearly by entry level programmers without the unnecessary documentation lookup.
PR Summary
PR Checklist