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
Figures in the notebook backend are too large following DPI changes #5945
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
changed the title [-]Changes to figure dpi are not suitable for the notebook backend[/-][+]Figure size in notebook backend depends on DPI (Changes to figure dpi are not suitable for the notebook backend)[/+]on Jan 29, 2016
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...
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.
changed the title [-]Figure size in notebook backend depends on DPI (Changes to figure dpi are not suitable for the notebook backend)[/-][+]Figures in the notebook backend are too large following DPI changes[/+]on Mar 28, 2016
Activity
jenshnielsen commentedon Jan 29, 2016
On 1.5.1

On 2.x
I bisected the change to a903315 as indicated above
[-]Changes to figure dpi are not suitable for the notebook backend[/-][+]Figure size in notebook backend depends on DPI (Changes to figure dpi are not suitable for the notebook backend)[/+]jenshnielsen commentedon Jan 29, 2016
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.
mdboom commentedon Jan 29, 2016
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...
jenshnielsen commentedon Jan 29, 2016
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
efiring commentedon Jan 29, 2016
Is it possible for the notebook backend to ask the browser what it thinks the actual screen dpi is?
mdboom commentedon Jan 29, 2016
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.
Fix matplotlib#5945: Set the default figure size in notebook
[-]Figure size in notebook backend depends on DPI (Changes to figure dpi are not suitable for the notebook backend)[/-][+]Figures in the notebook backend are too large following DPI changes[/+]jenshnielsen commentedon Apr 25, 2016
closed by #6290