You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
indicate_inset_zoom sometimes draws incorrect connector lines #12323
Actually, I think my "expected outcome" is not the proper solution, but looks the best without modifying the source. My ideal output would have the connecting lines drawn from the two corners of the rectangle closest to the inset to the closest two inset corners.
The algorithm tries to draw the best opposing corners. Your inset axes is basically centered on the indicator on the main axes so it chooses something that looks a little funny. Thats why we put the manual visibility toggles in there, for cases where the naive algorithm returns something that doesn't look nice.
Actually, I think my "expected outcome" is not the proper solution, but looks the best without modifying the source. My ideal output would have the connecting lines drawn from the two corners of the rectangle closest to the inset to the closest two inset corners.
That would be easy, but unexpected. The lines connect corners in the indicator with corners on the inset axes. I'd be against a change that didn't conserve this mapping.
Some people's goal it is to deprecate axes_grid1. I would be careful to make that a self-fulfilling prophecy. People's bandwidth is much better used with solving real-world problems than with deconstructing parts of the library.
I think indicate_inset_zoom (or indicate_inset) could well take 4 location parameters as input, similar to the hand-written function above, or as part of a single list of dict, to allow the user to easily modify the connection lines.
I think getting the "expected result" automatically is not too difficult, but the so-called "ideal result" is perhaps not so easy and open to debate as to whether it's wanted. I know how to write the former at least and can open a PR for it.
I don't feel like what's called "ideal" here should be the default. The "expected" is probably what people would expect indeed.
But giving users the option to easily obtain their custom desired look is very desireable in my eyes.
Changing the defaults is fine w me. It’s just an aesthetic decision and for most placements I thought what was implemented was the best without doing anything too complicated. But if something can be done that’s reasonable that’s be great.
Expanding the API could also be nice, but a bit of thought should go into the best form.
Activity
dstraus commentedon Sep 28, 2018
Actually, I think my "expected outcome" is not the proper solution, but looks the best without modifying the source. My ideal output would have the connecting lines drawn from the two corners of the rectangle closest to the inset to the closest two inset corners.
jklymak commentedon Sep 28, 2018
The algorithm tries to draw the best opposing corners. Your inset axes is basically centered on the indicator on the main axes so it chooses something that looks a little funny. Thats why we put the manual visibility toggles in there, for cases where the naive algorithm returns something that doesn't look nice.
That would be easy, but unexpected. The lines connect corners in the indicator with corners on the inset axes. I'd be against a change that didn't conserve this mapping.
ImportanceOfBeingErnest commentedon Sep 28, 2018
There is
mpl_toolkits.axes_grid1.inset_locator.inset_axesandmark_inset. You may get the "desired outcome" with those asYou may get the "ideal" outcome with a bit of customization.
jklymak commentedon Sep 28, 2018
OK, but fair warning that the goal is to deprecate
axes_grid1. If you want to make your own connection lines, you can usepatches.ConnectionPatch:will add a line from the lower right of the inset to the lower left of the inset indicator.
jklymak commentedon Sep 28, 2018
ImportanceOfBeingErnest commentedon Sep 28, 2018
Some people's goal it is to deprecate
axes_grid1. I would be careful to make that a self-fulfilling prophecy. People's bandwidth is much better used with solving real-world problems than with deconstructing parts of the library.I think
indicate_inset_zoom(orindicate_inset) could well take 4 location parameters as input, similar to the hand-written function above, or as part of a single list of dict, to allow the user to easily modify the connection lines.jklymak commentedon Sep 28, 2018
Maintaining and documenting
axes_grid1was also taking up a lot of bandwidth. 😉In this case the new API has the same coverage as the old.
We could discuss a more flexible connector line API, but again, there is a cost/benefit to doing so.
QuLogic commentedon Sep 29, 2018
I think getting the "expected result" automatically is not too difficult, but the so-called "ideal result" is perhaps not so easy and open to debate as to whether it's wanted. I know how to write the former at least and can open a PR for it.
ImportanceOfBeingErnest commentedon Sep 29, 2018
I don't feel like what's called "ideal" here should be the default. The "expected" is probably what people would expect indeed.
But giving users the option to easily obtain their custom desired look is very desireable in my eyes.
jklymak commentedon Sep 29, 2018
Changing the defaults is fine w me. It’s just an aesthetic decision and for most placements I thought what was implemented was the best without doing anything too complicated. But if something can be done that’s reasonable that’s be great.
Expanding the API could also be nice, but a bit of thought should go into the best form.
Thanks for the interest in improving this!
ImportanceOfBeingErnest commentedon Sep 29, 2018
The immediate issue ("expected outcome") is solved by #12334. Should this be reopened to discuss adding customization ("ideal outcome")?
dstraus commentedon Sep 30, 2018
You should leave it closed. I think the "expected outcome" is correct and my "ideal outcome" was not, after reading the comments.
jklymak commentedon Sep 30, 2018
Thanks for the report @dstraus - that lead to a nice improvement by @QuLogic !