Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Replace subplot(ijk) calls by subplots(i, j)#18567
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -602,26 +602,21 @@ def test_fill_units(): | ||
dt = np.arange('2009-04-27', '2009-04-29', dtype='datetime64[D]') | ||
dtn = mdates.date2num(dt) | ||
fig, ((ax1, ax2), (ax3, ax4))= plt.subplots(2, 2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I am not a fan of this idiom versus There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think which is better depends on what you are doing (a grid of similar Axes or a grid of very different Axes). In this case the code was previously using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. And I think it also depends on the names you use, fig, (ax_hist,ax_map)=plt.subplots(2) seems much better that slicing into an array (which is similar to the argument of why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I agree with@tacaswell, especially since this minimizes changes. | ||
ax1.plot([t], [value], yunits='deg', color='red') | ||
ind = [0, 0, 1, 1] | ||
ax1.fill(dtn[ind], [0.0, 0.0, 90.0, 0.0], 'b') | ||
ax2.plot([t], [value], yunits='deg', color='red') | ||
ax2.fill([t, t, t + day, t + day], | ||
[0.0, 0.0, 90.0, 0.0], 'b') | ||
ax3.plot([t], [value], yunits='deg', color='red') | ||
ax3.fill(dtn[ind], | ||
[0 * units.deg, 0 * units.deg, 90 * units.deg, 0 * units.deg], | ||
'b') | ||
ax4.plot([t], [value], yunits='deg', color='red') | ||
ax4.fill([t, t, t + day, t + day], | ||
[0 * units.deg, 0 * units.deg, 90 * units.deg, 0 * units.deg], | ||
@@ -635,22 +630,16 @@ def test_single_point(): | ||
matplotlib.rcParams['lines.marker'] = 'o' | ||
matplotlib.rcParams['axes.grid'] = True | ||
fig, (ax1, ax2) = plt.subplots(2) | ||
ax1.plot([0], [0], 'o') | ||
ax2.plot([1], [1], 'o') | ||
# Reuse testcase from above for a labeled data test | ||
data = {'a': [0], 'b': [1]} | ||
fig, (ax1, ax2) = plt.subplots(2) | ||
ax1.plot('a', 'a', 'o', data=data) | ||
ax2.plot('b', 'b', 'o', data=data) | ||
@image_comparison(['single_date.png'], style='mpl20') | ||
@@ -721,7 +710,7 @@ def test_axvspan_epoch(): | ||
dt = units.Duration("ET", units.day.convert("sec")) | ||
ax = plt.gca() | ||
ax.axvspan(t0, tf, facecolor="blue", alpha=0.25) | ||
ax.set_xlim(t0 - 5.0*dt, tf + 5.0*dt) | ||