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

Skip to content

nbagg backend stops working #4168

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

Closed
asteppke opened this issue Feb 26, 2015 · 8 comments · Fixed by #4171
Closed

nbagg backend stops working #4168

asteppke opened this issue Feb 26, 2015 · 8 comments · Fixed by #4171
Milestone

Comments

@asteppke
Copy link

With the the current matplotlib version 1.4.3 using python 3.4.1 from Anaconda on Windows 7 I tried using the new nbagg backend.

The test code is

import numpy as np

import matplotlib

matplotlib.use('nbagg')
from matplotlib import pyplot as plt

x = np.linspace(0, 4, 100)
f = lambda x: x**2 + np.cos(5*x)

plt.plot(x, f(x))
plt.show()

This gives me a plot with the interactive controls from the nbagg backend. Now I can use the pan tool and move the axis a little bit. This works 3-4 times, after than the pan tool stops work, similarly the zoom tool. The download button is the only one working, all other functions cease to run.

@mdboom
Copy link
Member

mdboom commented Feb 26, 2015

Is there any output from the console?

@asteppke
Copy link
Author

No, there is no message on the ipython console. Restarting the current kernel and running all cells again does not help either.
I can pan a bit again after reloading the page though.

@tacaswell
Copy link
Member

What browser?

I have seen issues with clicking too fast and something gets out of sync with the comms.

@tacaswell tacaswell added this to the next point release milestone Feb 26, 2015
@asteppke
Copy link
Author

I see this issue in the current version of Chrome (40.0.2214.115 m). On Internet Explorer 11 I cannot reproduce the problem here.

@tacaswell
Copy link
Member

attn @minrk who on the IPython side should we ping about this sort of thing?

@asteppke
Copy link
Author

Just to test if this is any different with a newer IPython version I installed the current github IPython/Jupyter 3.0 development version and can still reproduce the issue.

@minrk
Copy link
Contributor

minrk commented Feb 26, 2015

@tacaswell pinging me is fine.

After a bit of digging, it appears that the problem is related to fig.waiting being stuck to true, and not getting unset by an apparently expected image.onload event that doesn't come. I think the cause is that image.onload doesn't fire when you set the image data if the value hasn't actually changed (example notebook).

I think moving the waiting = false to something that always fires should fix the issue that I'm seeing, at least.

@minrk
Copy link
Contributor

minrk commented Feb 26, 2015

#4171 moves the assignment of waiting = false so that it should always be set on every change, instead of onload. I'm not sure, but it might also make sense to force waiting = false when receiving a draw message on the javascript side. Right now, when the kernel sends a draw message and the frontend has waiting = true, the frontend does not send the draw message back to the kernel. This may be the intended behavior, but if not, it would be a good way of ensuring that an inappropriately sticky waiting = true is easy to unstick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants