Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Let connectionpatch be drawn on figure level #15020

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

ImportanceOfBeingErnest
Copy link
Member

PR Summary

Previously adding a ConnectionPatch to a figure as fig.add_artist(ConnectionPatch(..)) would fail with an error (error shown in #8744 (comment)).

However it would be good to be able to use ConnectionPatch on a figure level because

Thereby closes #8744 in the sense that we would advise users to use fig.add_artist in such case.

Documentation and examples for that would be part of #14957

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 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

@@ -396,6 +396,18 @@ def test_connection_patch():
ax2.add_artist(con)


def test_connection_patch_fig():
Copy link
Member

Choose a reason for hiding this comment

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

Does this need some sort of image test as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Previously it would error out, so I added this just as a smoke test to make sure it doesn't. The functionality should be sufficiently tested by the other image test.
I mean, I could of course add this to the existing image test (just being lazy here); if people find it necessary, let me know.

Copy link
Member

Choose a reason for hiding this comment

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

Up to you if you think this will keep it from getting broken is the only reason we have tests

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I'd say this is sufficient to test what's being changed here. Of course one could argue that in general we do not test all of the possible combinations of parameters, and for each with and without contrained_layout, etc...

@ImportanceOfBeingErnest ImportanceOfBeingErnest force-pushed the let-connectionpatch-be-drawn-on-figure-level branch from 6898022 to 03c88e8 Compare August 9, 2019 23:23
@anntzer anntzer merged commit 6f4dd80 into matplotlib:master Aug 10, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Aug 10, 2019
dstansby added a commit that referenced this pull request Aug 10, 2019
…020-on-v3.1.x

Backport PR #15020 on branch v3.1.x (Let connectionpatch be drawn on figure level)
@ImportanceOfBeingErnest ImportanceOfBeingErnest deleted the let-connectionpatch-be-drawn-on-figure-level branch August 10, 2019 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConnectionPatch hidden by plots
3 participants