Hi,
I'm not sure this is a seaborn issue but I just update to ipython 3 and the seaborn style darkgrid shows a transparent (white) background and no grid (probably invisible due to the white notebook background).
System info: Windows 7 x64, anaconda 64bits, matplotlib 1.4.3, seaborn 0.5.1, ipython 3.
Are you calling %matplotlib inline after you import seaborn?
Yes, in a few points have to switch to the QT backend for some interactive plot and then I switch back to inline.
I think they changed something about how setting inline plots work that overrides the configuration seaborn does; you can call sns.set() or sns.set_style after you change your backend.
I already do set the style with set_style just after the plot but the background is still transparent (I can tell this because I have a large figure that spills outside the central panel where the background changes to gray).
It won't work if you do it after the plot, the style parameters become a property of the figure/axes object at the time it's instantiated, so it doesn't matter what the global parameters are at draw time.
Ok, thanks. If I do
%matplotlib inline
seaborn.set_style('darkgrid')
it works. I was inverting the order of these two lines. It used to work in ipython 2.x even with inverted order but this solution is good enough to me.
As far as I am concerned you can close the issue, thanks.
Wait, I still have some redundant %matplotlib inline here and there and the background switches back to transparent.
I mean:
%matplotlib inline
seaborn.set_style('darkgrid')
works, then a cell like
%matplotlib inline
(even without changing to QT in between) switches back to transparent background. I can work around it but just to let you know.
Yes, %matplotlib is changing more rc parameters in 3.0 than it did in the past. I doubt there's anything that seaborn could do to work around that (automatically), but I haven't had time to figure out if it's required/intended behavior in IPython or a bug that can be fixed on their end.
Opened an issue on IPython, so we'll wee what they do. Closing here as nothing to do on the seaborn side of things.
Most helpful comment
I think they changed something about how setting inline plots work that overrides the configuration seaborn does; you can call
sns.set()orsns.set_styleafter you change your backend.