Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
dopplershift merged 1 commit intomatplotlib:masterfromtimhoffm:subplot-cleanup
Sep 25, 2020

Conversation

timhoffm
Copy link
Member

PR Summary

Addresses part of the cases of#17335.

Plus some minor cleanup along the way.

@timhoffmtimhoffm added this to thev3.4.0 milestoneSep 24, 2020
@@ -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= plt.figure()
fig, ((ax1, ax2), (ax3, ax4))= plt.subplots(2, 2)
Copy link
Member

Choose a reason for hiding this comment

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

I am not a fan of this idiom versusfig, axs = plt.subplots(2, 2). You lose the ability to iterate if you spell them all out like this.

Copy link
Member

Choose a reason for hiding this comment

The 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 usingaxN so this is the minimal touch to move away fromadd_subplot(XYZ).

Copy link
Member

Choose a reason for hiding this comment

The 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 whysubplot_mosaic returns a dict).

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with@tacaswell, especially since this minimizes changes.

@@ -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= plt.figure()
fig, ((ax1, ax2), (ax3, ax4))= plt.subplots(2, 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with@tacaswell, especially since this minimizes changes.

@dopplershiftdopplershift merged commiteeb32ac intomatplotlib:masterSep 25, 2020
@timhoffmtimhoffm deleted the subplot-cleanup branchSeptember 25, 2020 07:24
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@jklymakjklymakjklymak left review comments

@dopplershiftdopplershiftdopplershift approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.4.0
Development

Successfully merging this pull request may close these issues.

4 participants
@timhoffm@tacaswell@dopplershift@jklymak

[8]ページ先頭

©2009-2025 Movatter.jp