带有Seaborn的matplotlib 1.4.2:线标记不起作用 [英] matplotlib 1.4.2 with Seaborn: line markers not functioning

查看:147
本文介绍了带有Seaborn的matplotlib 1.4.2:线标记不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意:此问题已在1.4.3或更高版本中修复

Note: this is fixed in 1.4.3 or later

我使用Seaborn绘图软件包,并且刚刚升级到Matplotlib的最新版本.现在,带有点符号的图不再渲染.以前可以使用的代码现在可以创建空白图,但是仅在导入Seaborn时才可以.这是一些示例代码:

I use the Seaborn plotting package and I just upgraded to the newest version of Matplotlib. Now, plots with dot symbols no longer render. Code that was functional before now creates blank plots, but only when Seaborn is imported. Here's some sample code:

import matplotlib.pyplot as plt
import matplotlib
import numpy as np

print matplotlib.__version__

Matplotlib版本:

Matplotlib version:

1.4.2

创建没有剧情的剧情:

x = np.linspace(0,2,101)
y = np.sin(2*np.pi*x)
plt.plot(x,y,'.')

导入seaborn,打印版本:

Import seaborn, print the version:

import seaborn as sns
print sns.__version__

Seaborn版本:

Seaborn version:

0.4.0

使用进口的seaborn创建线图:

Create a line plot with seaborn imported:

plt.plot(x,y,'-')

使用seaborn导入创建点图会给出一组空白的轴:

Creating a dot plot with seaborn imported gives a blank set of axes:

plt.plot(x,y,'.')

上面的所有操作都是在IPython笔记本中完成的,但我只是在Spyder中尝试了以下操作,结果相同:

Everything above was done in the IPython notebook, but I just tried the following in Spyder with the same result:

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中的错误所致.

It would appear that this is due to a bug in Matplotlib.

https://github.com/matplotlib/matplotlib/issues/3711

https://github.com/mwaskom/seaborn/issues/344

您可能暂时只需要降级.

You might just have to downgrade for the time being.

PS:Doug怎么了

PS: What's up Doug.

这篇关于带有Seaborn的matplotlib 1.4.2:线标记不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆