How to recover matplotlib defaults after setting stylesheet

前端 未结 3 1358
遥遥无期
遥遥无期 2020-12-04 13:20

In an ipython notebook, I used a matplotlib stylesheet to change the look of my plots using

from matplotlib.pyplot import *
%matplotlib inline
style.use(\'g         


        
3条回答
  •  再見小時候
    2020-12-04 13:29

    Adding to the answer by CT Zhu, the differences between the inline and matplotlib defaults are (for each item that is different, a list with the to respective values is given):

    inline_default_rc = dict(mpl.rcParams)
    default_rc = dict(mpl.rcParamsDefault)
    print( {k:[v,default_rc[k]] for k,v in inline_default_rc.items() if v != default_rc[k]} )
    
    {'figure.dpi': [72.0, 100.0], 'figure.edgecolor': [(1, 1, 1, 0), 'white'], 'figure.facecolor': [(1, 1, 1, 0), 'white'], 'figure.figsize': [[6.0, 4.0], [6.4, 4.8]], 'figure.subplot.bottom': [0.125, 0.11], 'interactive': [True, False]}
    

    You can use this to fine tune your plots.

提交回复
热议问题