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
Default setting of figure transparency in NbAgg is a performance problem #5419
I missed the implications of #3552 when it went through.
If any part of the plot image is transparent, a full image frame is sent in order to make sure there isn't any ghosting. The default value of nbagg.transparent == True unfortunately means that full images are always sent for every frame. This results in lower framerates and flickering.
I can workaround this by setting figure.facecolor: white and nbagg.transparent: False, but I wonder if we shouldn't make this the default. 2.0 might be a good opportunity to make figure.facecolor: white the default for every backend anyway, which does generally look more modern.
It does mean it IPython ever changes their style to something on a non-white background things may not look as nice, but we'll cross that when we get there.
I think the reason why that setting was set that way was to match the
appearance for the inline images. Quite honestly, I hate that, as it has
bitten me multiple times when I copy an image over from a notebook to
PowerPoint...
I missed the implications of #3552 #3552 when it went through.
If any part of the plot image is transparent, a full image frame is sent
in order to make sure there isn't any ghosting. The default value of nbagg.transparent
== True unfortunately means that full images are always sent for every
frame. This results in lower framerates and flickering.
I can workaround this by setting figure.facecolor: white and nbagg.transparent:
False, but I wonder if we shouldn't make this the default. 2.0 might be a
good opportunity to make figure.facecolor: white the default for every
backend anyway, which does generally look more modern.
It does mean it IPython ever changes their style to something on a
non-white background things may not look as nice, but we'll cross that when
we get there.
Correct, setting the background to white for inline images would fix that,
but isn't that handled by IPython? And yes, I hate transparent images in
general.
This sounds related to a problem I just ran into with master, and with %matplotlib notebook: saving to a png with fig.savefig, I could not find a way to make the png figure background white instead of transparent. Has anyone else seen this? To get around it I had to switch to using %matplotlib inline.
If any part of the plot image is transparent, a full image frame is sent in order to make sure there isn't any ghosting.
We could be more sophisticated with the solution - we could send over only the semi-transparent pixels as a separate message and clear those pixels before applying them on the JS side.
Either way, I'm 👍 on producing white borders by default - for both nbagg and all other backends. I've disliked the fact that we have a savefig.transparent setting which changes how a figure looks between interactivity and savefig for some time, and this would go some way to fixing that.
Activity
WeatherGod commentedon Nov 6, 2015
I think the reason why that setting was set that way was to match the
appearance for the inline images. Quite honestly, I hate that, as it has
bitten me multiple times when I copy an image over from a notebook to
PowerPoint...
On Fri, Nov 6, 2015 at 9:53 AM, Michael Droettboom <notifications@github.com
mdboom commentedon Nov 6, 2015
Ok -- that at least makes some sense. But wouldn't setting the background to white for inline images also be one way to fix that?
Meaning you hate that the inline images are transparent or vice versa?
WeatherGod commentedon Nov 6, 2015
Correct, setting the background to white for inline images would fix that,
but isn't that handled by IPython? And yes, I hate transparent images in
general.
On Fri, Nov 6, 2015 at 10:33 AM, Michael Droettboom <
notifications@github.com> wrote:
mdboom commentedon Nov 6, 2015
Yes -- I think IPython sets the transparent background on inline images. We can always lobby them to stop if that makes sense... ;)
jenshnielsen commentedon Nov 6, 2015
Yes it's set here https://github.com/ipython/ipykernel/blob/master/ipykernel/pylab/config.py
efiring commentedon Nov 6, 2015
This sounds related to a problem I just ran into with master, and with
%matplotlib notebook: saving to a png withfig.savefig, I could not find a way to make the png figure background white instead of transparent. Has anyone else seen this? To get around it I had to switch to using%matplotlib inline.pelson commentedon Nov 8, 2015
We could be more sophisticated with the solution - we could send over only the semi-transparent pixels as a separate message and clear those pixels before applying them on the JS side.
Either way, I'm 👍 on producing white borders by default - for both nbagg and all other backends. I've disliked the fact that we have a
savefig.transparentsetting which changes how a figure looks between interactivity and savefig for some time, and this would go some way to fixing that.Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white
Fix matplotlib#5419: Set default figure background to white