Skip to content

Improve selection of inset indicator connectors. - #12334

Merged
ImportanceOfBeingErnest merged 1 commit into
matplotlib:masterfrom
QuLogic:inset-indicators
Sep 29, 2018
Merged

ImportanceOfBeingErnest merged 1 commit into
matplotlib:masterfrom
QuLogic:inset-indicators

Conversation

@QuLogic

@QuLogic QuLogic commented Sep 29, 2018

Copy link
Copy Markdown
Member

PR Summary

Instead of selecting just one pair of corners, determine whether each connector is visible individually based on relative position of the bbox corners that each one connects.
It took me a couple of false starts, but ended up relatively simple in the end.

Fixes #12323.

Since it's marked experimental, I'll leave it to @jklymak to determine milestoning, and then write up the changelog accordingly, and maybe update the test too.

On master

master

This PR

fix

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

Instead of selecting just one pair of corners, determine whether each
connector is visible individually based on relative position of the bbox
corners that each one connects.
@jklymak jklymak added this to the v3.0.x milestone Sep 29, 2018

@jklymak jklymak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very elegant!

@jklymak

jklymak commented Sep 29, 2018

Copy link
Copy Markdown
Member

This is great. You should include the code for the above as an example somewhere too!

I assume this works as well w an oblong shape as well?

@ImportanceOfBeingErnest

Copy link
Copy Markdown
Member

Cool stuff.

If you look closely there is a little hickup at ~0°. (Image taken from screen capture of the above animation)

image

I'm not able to reproduce this locally. Is this expected?

@QuLogic

QuLogic commented Sep 29, 2018

Copy link
Copy Markdown
Member Author

Hmm, that is weird, but the way ConnectionPatchs seem to work is that they need an extra draw to make sure everything is in place. I suspect this is some artifact of that combined with the animation code to produce the first frame a bit too early. You can see this sort of effect if you just run a static plot and resize the window quickly.

@QuLogic

QuLogic commented Sep 29, 2018

Copy link
Copy Markdown
Member Author

Oblong shapes seem fine (and should be since this looks at individual corners now):
fix2

@jklymak

jklymak commented Sep 29, 2018

Copy link
Copy Markdown
Member

For the drawing bug have a look at: #11753

@ImportanceOfBeingErnest
ImportanceOfBeingErnest merged commit 97cad3d into matplotlib:master Sep 29, 2018
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 29, 2018
@QuLogic
QuLogic deleted the inset-indicators branch September 29, 2018 20:31
ImportanceOfBeingErnest added a commit that referenced this pull request Sep 30, 2018
…334-on-v3.0.x

Backport PR #12334 on branch v3.0.x (Improve selection of inset indicator connectors.)
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.

indicate_inset_zoom sometimes draws incorrect connector lines

3 participants