Skip to content

"%matplotlib notebook" Download is Noise After Interacting with Plot #17807

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
TylerHorvath opened this issue Jun 30, 2020 · 4 comments
Closed

Comments

@TylerHorvath
Copy link

TylerHorvath commented Jun 30, 2020

Bug report

Bug summary

After using the "%matplotlib notebook" magic command and interacting with the plot using "Pan" or "Zoom to Rectangle" the "Download Plot" button produces a image comprising of static. Before interaction it downloads the image as expected. I will note that in my browser the plot is actually subtle white and grey noise in place of the black as seen below

Code for reproduction

%matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0,2*np.pi,50)
plt.plot(x,np.sin(x))
plt.show()

Actual outcome

Download Plot without interaction:
image

Download Plot after using "Pan" only
image

Download plot after using "Zoom to Rectangle" to zoom in on x from 0 to pi
image

Download plot after using "Pan" THEN "Zoom to Rectangle"
image

Download plot after using "Zoom to Rectangle" THEN"Pan"
image

Expected outcome
Not static, for example using "Zoom to Rectangle" to zoom in on x from 0 to pi
image

Matplotlib version

First System:

  • Operating system: Linux Kernel 3.10.0-862.el7.x86_64
  • Matplotlib version: 3.1.3
  • Matplotlib backend (nbAgg):
  • Python version: 3.7.6
  • Jupyter version (if applicable): 6.0.3
  • Browser : Firefox
  • Other libraries:

Second System:

  • Operating system:Windows 10 18363.900 machine
  • Matplotlib version: 3.2.2
  • Matplotlib backend (nbAgg):
  • Python version: 3.7.4
  • Jupyter version (if applicable): 6.0.3
  • Browser: Firefox
  • Other libraries:

To be honest I'm not incredibly sure how the Linux system was set up since I am mostly just using it remotely (both with X-forwarding and using remote kernels), but for the Windows system I install and update everything using Anaconda or conda commands in cmd.

I haven't been able to find anything to fix this issue, and I've tried changing the backend but I'm not familiar enough with those to mess around with them, hopefully theres some kind of solution directly within the code or through upgrading/downgrading some packages. Thanks!

@tacaswell
Copy link
Member

Interesting. To try in improve performance what we send between the font end and the kernel is diffs between subsequent views (long runs of 0 compress really well!) so what you are seeing is the diff not static (which is still not right, but at least explainable).

Can you try with the 3.3.0rc1 release (pip install --upgrade --pre matplotlib)? I can not reproduce this with firefox with 3.3.0rc1 but can reproduce it with 3.2.2.

@tacaswell
Copy link
Member

I am inclined to close this as fixed (likely as part of @QuLogic 's overhaul to remove jquery), but would like someone else to confirm.

@tacaswell
Copy link
Member

On second thought, to make the logistics easier I am going to close this issue.

@TylerHorvath Please ping to have it re-opened if the RC does not fix it for you!

@QuLogic
Copy link
Member

QuLogic commented Jun 30, 2020

This would have been fixed by #17027.

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

No branches or pull requests

3 participants