I have seen this question come up a couple of times, but I think this information changes as jupyter/ipython get updated. I am currently running python 3.5, jupyter (latest) and matplotlib 2.0.
The %matplotlib inline
plots have custom properties that are set after the matplotlibrc file is imported. The most annoying of these is that the figure.facecolor
property is set to be transparent which wreaks havoc when copy/pasting plots so I have to reset this property in the notebook. I cannot seem to find where this property is changed, or if it is possible to create a configuration profile somewhere to change these special inline
plot settings
My question is, is it possible to change these settings, and if so, how would I do that?
Some of the rcParameters are set specifically for the
inline
backend. Those areAnd the place where they reside is the
ipykernel/pylab/config.py
file. This file can be edited to obtain the desired behaviour, e.g. by changing the facecolor to'figure.facecolor': (1,1,1,1)
(no transparency).Another option is the following:
The rcParameters are defined as part of the
InlineBackend
class, specifically theInlineBackend.rc
attribute which is atraitlets.Dict
object.Those can be changed using the ipython configuration system as follows.
From the command line type
ipython profile create
which will generate the default configuration files in~/.ipython
. In the main configuration file~/.ipython/ipython_config.py
include the line: