I'd like the background of my matplotlib plots to be transparent in my IPython notebook. This may sound silly because the notebook itself defaults to a white background but:
1) I use a solarized background and
2) more importantly, I want them to be transparent for when I embed the notebook directly into my blog via nbconvert
.
It's easy enough to use something like savefig('file', transparent=True)
, but I'm not saving the figures, I am displaying them inline (by calling IPython with ipython notebook --matplotlib inline
.
I've been playing around with the IPython notebook configuration file, especially with c.InlineBackend.rc
. For example, I upgraded to the dev version of matplotlib to get access to its new savefig.transparent
rcParam, and tried configuring that with c.InlineBackend.rc = {'savefig.transparent': True}
, but as expected it only affects plots saved with savefig
.
Note that I am using the recent IPython 2.0 release. This must be possible somehow, right? Any light that you can shed would be appreciated.
savefig
directly when it uses matplotlib inline. Maybe it is using some lower level function? I'll poke around and try to find out, but hopefully someone more knowledgable about these things knows off the top of their head.