-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Figures in the notebook backend are too large following DPI changes #5945
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
Comments
On 2.x I bisected the change to a903315 as indicated above |
Thinking a bit more about this it seems like the issue is that the figure size depends on the DPI of the image generated which is should not. |
I'm not seeing the fuzzyness in the second image. One would expect the image to be larger when increasing the DPI -- since figure size comes not from the notebook, but from a hard coded default in inches from matplotlibrc. That said, I think we need to get better about communicating the best size from the notebook to matplotlib, which would resolve this issue. I don't recall if that's one of the things fixed by #5754 or not... |
You are right of cause. The only thing that determines the figure size on screen is the number of pixels in the png which grows with dpi change. That being said I still think the default figure size is way to large for the notebook now. And I still see the fuzzyness. Compare 1.5.1 2.x 2.x with dpi 80 I have scaled the figure size in these examples to create a figure with both the old and the new size by multiplying with 10/8 and 8/10 respectively |
Is it possible for the notebook backend to ask the browser what it thinks the actual screen dpi is? |
I don't think so -- the best you get is whether the browser is in "retina mode" (scaling) or not. But you can get the width of the cell, or the width of the document frame, which while not the same thing would allow us to shrink the figure accordingly to fit. |
to something smaller that fits in the webbrowser well
closed by #6290 |
The changes to the figure dpi in a903315 makes the figure in the notebook backend larger and more fuzzy. Presumably because the size of the figure is not set correctly in the nbagg backend and the figure ends up being rescaled to the same default display dpi
Edit:
The actual issue is just that the figures are now larger because we increased the DPI.
The actual figure size in the notebook is in pixels so that the figure size in pixels will be dpi * figsize_in_inches exactly as is should be however the figure is subjectively to large
The text was updated successfully, but these errors were encountered: