Ipython笔记本3禁用seaborn设置

我刚刚升级到IPython Notebook 3.0版,并且禁用了seaborn的格式。 以下是一些复制问题的示例代码

import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns

%matplotlib inline

data = np.random.randn(100)

fig,ax = plt.subplots(figsize = (11,8.5))
ax.plot(data)

此代码在IPython Notebook V2.4.1中运行良好(请参阅http://nbviewer.ipython.org/gist/anonymous/71733c24a68ee464ca40),但在IPython Notebook v3.0中,这些轴变为不可见(请参阅http:// nbviewer。 ipython.org/gist/anonymous/7525146b07709206908c)。

奇怪的是,在V3中,当我切换seaborn导入和matplotlib内联魔法的顺序时,情节通常会在我第一次运行时呈现,然后如果我重新运行,则轴和网格线会消失。 所以这似乎与内联魔法禁用seaborn属性有关。

除第一次之后不重新执行我的导入之外的任何解决方法?


在iPython Notebook 3.0中,添加:

seaborn.set_style('darkgrid')

恢复Seaborn默认配色方案。

链接地址: http://www.djcxy.com/p/25247.html

上一篇: Ipython notebook 3 disables seaborn settings

下一篇: How can I use TTask.WaitForAny from the new threading library?