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

Use subplots() instead of axes_grid in suitable examples.#10127

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
jklymak merged 1 commit intomatplotlib:masterfromanntzer:subplots-examples
Dec 29, 2017

Conversation

anntzer
Copy link
Contributor

@anntzeranntzer commentedDec 29, 2017
edited
Loading

PR Summary

These are examples where subplots() is just as good as axes_grid to set up the axes.

In simple_annotate01, the subplots order was swapped to allow the
"connectionstyle=arc3" label to overflow without being cut off.

For reference, compare

https://matplotlib.org/gallery/userdemo/annotate_explain.html#sphx-glr-gallery-userdemo-annotate-explain-py
https://matplotlib.org/gallery/userdemo/simple_annotate01.html#sphx-glr-gallery-userdemo-simple-annotate01-py
https://matplotlib.org/gallery/userdemo/connectionstyle_demo.html#sphx-glr-gallery-userdemo-connectionstyle-demo-py

and

https://955-7439715-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/gallery/userdemo/annotate_explain.html#sphx-glr-gallery-userdemo-annotate-explain-py
https://955-7439715-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/gallery/userdemo/simple_annotate01.html#sphx-glr-gallery-userdemo-simple-annotate01-py
https://955-7439715-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/gallery/userdemo/connectionstyle_demo.html#sphx-glr-gallery-userdemo-connectionstyle-demo-py

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

In simple_annotate01, the subplots order was swapped to allow the"connectionstyle=arc3" label to overflow without being cut off.
Copy link
Member

@dstansbydstansby left a comment

Choose a reason for hiding this comment

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

Big 👍 for this

@dstansbydstansby added this to thev2.1.2 milestoneDec 29, 2017
Copy link
Member

@jklymakjklymak left a comment

Choose a reason for hiding this comment

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

I don't think either comment is a blocker, and I'm all for reducing AxesGrid in the docs, but these examples don't look like the old ones. Is that OK? I think I'm OK w/ it, but wanted to point it out.



fig, axs = 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.

Did you change the shape on purpose? I don't really mind, but the original was 1x4...

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Then you'd need to set a figsize (otherwise the subplots are really small), and it just works as well without it after reshaping to (2, 2). Basically, trying to concentrate the example on the relevant points.

(the connectionstyle example does set the figsize because I don't think it can really be made to work nicely without it).

@@ -8,61 +8,38 @@
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches


fig, axs = plt.subplots(2, 4)
Copy link
Member

Choose a reason for hiding this comment

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

Again, I don't mind it, but this one is pretty different from the old version.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

The previous example had a bunch of empty, useless subplots.
The reason for reordering the subplots is explained above, but again it's just so that "connectionstyle=arc3" doesn't get overwritten by the next subplot.

@jklymakjklymak merged commit884060a intomatplotlib:masterDec 29, 2017
@jklymak
Copy link
Member

Thanks@anntzer

@anntzeranntzer deleted the subplots-examples branchDecember 29, 2017 20:14
tacaswell added a commit that referenced this pull requestDec 30, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak left review comments

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v2.1.2
Development

Successfully merging this pull request may close these issues.

3 participants
@anntzer@jklymak@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp