按照此处的过程,我有一个matplotlibrc
带有 matplotlib 配置选项的自定义文件。当我第一次启动 Jupyter QtConsole(通过终端,如果这很重要)时,正在读取文件 - 绘图使用我设置的选项,例如虚线网格线:
%matplotlib inline
plt.plot([1, 2, 3])
Out[2]: [<matplotlib.lines.Line2D at 0x9d2fe80>]
文件在matplotlibrc
这里:
mpl.matplotlib_fname()
Out[4]: 'C:\\Users\\my_username\\.matplotlib\\matplotlibrc'
但是,如果我导入 seaborn:
import seaborn as sns
情节然后切换到seaborn风格:
plt.plot([1, 2, 3])
Out[6]: [<matplotlib.lines.Line2D at 0xceb9cc0>]
是否可以在保留原始绘图风格的同时还导入 seaborn? 我想使用它的功能,例如seaborn.heatmap
,但不是它的样式。