-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Merged the fill_demo figures and changed the axes #8407
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
My students did this pull request. The continuous integration failure appears to have nothing to do with their changes. They just wrote some examples for the gallery. |
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.
This looks good, let's just clean up some of the variable names and remove redundant variables.
|
||
fig, ax = plt.subplots() | ||
fig, (ax1, ax3) = plt.subplots(1,2, sharey=True) |
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.
Can we just call it ax2
?
ax.fill(x, y, zorder=10) | ||
ax.grid(True, zorder=5) | ||
ax1.set_xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi]) | ||
ax1.set_xticklabels( ['$0$', r'$\frac{\pi}{2}$', r'$\pi$',r'$\frac{3\pi}{2}$',r'$2\pi$'] ) |
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.
remove whitespace between (
and [
(same for closing sides)
@@ -14,18 +14,28 @@ | |||
import numpy as np | |||
import matplotlib.pyplot as plt | |||
|
|||
x = np.linspace(0, 1, 500) | |||
y = np.sin(4 * np.pi * x) * np.exp(-5 * x) | |||
x1 = np.linspace(0, 2 * np.pi, 500) |
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.
let's make this x = np.linspace(0, 1, 500)
|
||
fig, ax = plt.subplots() | ||
ax.fill(x, y1, 'b', x, y2, 'r', alpha=0.3) | ||
x3 = np.linspace(0, 1, 500) |
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.
If we redefine x1
as i described above, we can remove this
|
||
ax3.set_title('fill_demo') | ||
ax3.set_xlabel('Time', labelpad=8) | ||
ax3.fill(x3, y3, zorder=10) |
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.
use x
, ax2
, etc
The title says "merged", but I don't see an old file being deleted? (This would also mean 2.1, in my mind.) |
I left x1 since x = np.linspace(0, 1, 500) changes the original shape of the figure. |
@jiyunshin Ah. you're right. I had to order of the args conflated. Going back to @QuLogic 's comment, is there another example that should be removed since you're merging two examples? |
We merged fill_demo.py and fill_demo_features.py into fill_demo.py. |
I'm a little confused. Where did you originally find the example to merge these two together? |
It might be good to wait until #8247 is merged before doing further changes on the gallery. Some of these files have been renamed in this PR. I wouldn't usually hold off PRs to wait for one to be merged, but this particular one has been ready to be merged for a while, and gets regular conflicts with master. |
http://matplotlib.org/examples/lines_bars_and_markers/fill_demo_features.html is the example that seems to have disappeared in the This just needs a PEP8 clean and a rebase; let us know @jiyunshin if you would like someone else to do that, and thanks for the PR. |
It looks like these have been merged by someone else: http://matplotlib.org/devdocs/gallery/lines_bars_and_markers/fill.html#sphx-glr-gallery-lines-bars-and-markers-fill-py Thanks a lot for the PR though, and apologies I didn't get around to fixing it up before someone else made the change! |
Improvement of gallery issue #7956
Merged fill_demo figure and fill_demo_features figure.
Modified the x-label and y-scaling.