matplotlib not using matplotlibrc file in IPython

后端 未结 2 556
粉色の甜心
粉色の甜心 2021-01-22 14:07

I recently upgraded from matplotlib v1.5.3 from v2.0.0, but with this change, it seems that matplotlib no longer uses my edited matplotlibrc file when plotting figures. When I o

2条回答
  •  深忆病人
    2021-01-22 14:18

    For me, the problem was that the matplotlibrc was working, then iPython was overriding it at the end of the cell. The way to check for this is to import matplotlib and print the plt.rcParams dict in the same cell, then run the same cell again. If it changes between calls, iPython is overriding it.

    The fix is to add

    c.InteractiveShellApp.matplotlib = 'inline'
    c.InlineBackend.rc = {}
    

    to your ipython_config.py. The second line tells iPython not to update the rParams dict.

提交回复
热议问题