-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
zoom/pan stack bug in 2.1.0 #9358
Comments
I'm looking at it, but it's not obvious why the previous code (before that patch) would even work for dynamically added axes. @DeadParrot Can you describe the sequence of actions / code that allows reproducing the issue (and used to work in 2.0)? Thanks. |
Sure, @anntzer. We have a QWidget that has a matplotlib canvas that we reuse for plots of different data sets the user selects. We could but we don't discard the canvas between plots. The |
Do you have a toolbar installed in your widget? |
Yes. We have a toolbar and we also wired up right-click to call |
OK, so I think the correct fix is to keep define_home hooked to draw_event and have it check whether the axes set has changed or not. If it has, push the state. |
I have the same issue in standard plots using TkAgg/Python 3.6.3. The original state is lost, the
(nothing else) The you move a few times, then press the home button - but don't return to the original zoom/viewport. This seems to be particularly reproducible in ipython, less so under plain python3. |
I seem to still see that issue on the current master branch but #9359 seems to fix it. Seems rather important to fix/merge. |
Is there a way to manually add the "home" zoom/pan level to the stack until this is fixed? |
Fixed by #9359 |
@tacaswell @anntzer Sadly, this seems to be broken again in 2.2.0. I can open a new issue for this if preferred. |
bummer ...
…On 07/03/18 12:58, Stuart Mentzer wrote:
@tacaswell <https://github.com/tacaswell> @anntzer
<https://github.com/anntzer> Sadly, this seems to be broken again in
2.2.0. I can open a new issue for this if preferred.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9358 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABNtFgcWGeaK9mV080GstSVj8kQOiIMJks5tbz7IgaJpZM4P02ND>.
|
@DeadParrot I have to admit, I cannot reproduce/confirm the existence of this issue in 2.2.0. Could you please provide an example? |
Can't reproduce it either... |
Sorry for the delay. I tried to build small examples showing the issue but since these worked I looked into our code and it looks like our toolbar class overrode the Upshot is that there was definitely an internal change in 2.2.0 that tripped us up but I can't conclude that it is a bug so let's leave this closed for now. Thanks! |
For plots after the first one created on a canvas the zoom/pan stacks can have
_pos
== -1 and, due to a change in 2.1.0 (fb83117), this position offset error causes unzoom and unpan back operations to think they have reached the top of the stack one step before they have.The code change that causes this was the removal of these lines from
press_pan
andpress_zoom
:which reset the Stack
_pos
to 0. Restoring this code corrects the issue but may not be the desired fix given the intended refactoring.Matplotlib version
print(matplotlib.get_backend())
): Qt4AggThe text was updated successfully, but these errors were encountered: