具有Seaborn的matplotlib 1.4.2:线标记不起作用
问题内容:
注意:此问题已在1.4.3或更高版本中修复
我使用Seaborn绘图程序包,并且刚刚升级到Matplotlib的最新版本。现在,带有点符号的图不再渲染。现在可以使用的代码现在可以创建空白图,但是仅在导入Seaborn时才可以。这是一些示例代码:
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
print matplotlib.__version__
Matplotlib版本:
1.4.2
创建一个没有seaborn的地块:
x = np.linspace(0,2,101)
y = np.sin(2*np.pi*x)
plt.plot(x,y,'.')
导入seaborn,打印版本:
import seaborn as sns
print sns.__version__
Seaborn版本:
0.4.0
使用seaborn导入创建线图:
plt.plot(x,y,'-')
使用seaborn导入创建点图会给出一组空白的轴:
plt.plot(x,y,'.')
上面的所有操作都是在IPython笔记本中完成的,但是我只是在Spyder中尝试了以下操作,结果相同:
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
print matplotlib.__version__
x = np.linspace(0,2,101)
y = np.sin(2*np.pi*x)
plt.figure()
plt.plot(x,y,'.')
import seaborn as sns
print sns.__version__
plt.figure()
plt.plot(x,y,'-')
plt.figure()
plt.plot(x,y,'.')
plt.show()
这是怎么回事?
问题答案:
看来这是由于Matplotlib中的错误所致。
https://github.com/matplotlib/matplotlib/issues/3711
https://github.com/mwaskom/seaborn/issues/344
您可能暂时只需要降级。
PS:道格怎么了。