【发布时间】:2017-11-15 08:13:10
【问题描述】:
我有一个带有 matplotlib 配置选项的自定义 matplotlibrc 文件,遵循过程 here。当我第一次启动 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,但不是它的样式。
【问题讨论】:
-
这些文件是否导入
seaborn?这就是 seaborn 风格。 -
很好,是的,就是这样。编辑了我的问题,因为这完全导致了另一个问题。
标签: python matplotlib seaborn qtconsole