我使用iPython Notebook进行科学应用程序,并且经常绘制实验数据集。iPython Notebook和Matplotlib的默认图像渲染和颜色循环行为非常糟糕,但是在进行以下调整后变得很好。
# ipython notebook specific
%pylab inline
# imports
from matplotlib import pyplot as plt
import matplotlib as mpl
from seaborn.apionly import set_palette
from IPython.display import set_matplotlib_formats
# configure plotting
set_matplotlib_formats('pdf', 'svg')
set_palette('Set1', n_colors=15, desat=None)
mpl.rcParams['figure.figsize']=(12.0,2.0)
我不想手动输入每本笔记本中的这些内容。我该如何使所有将来创建的笔记本都自动执行这些内容?