Matplotlib崩溃了

时间:2014-06-19 12:12:52

标签: python matplotlib

我尝试使用matplotlib学习数据可视化,但每当我尝试使用绘图函数时它都会崩溃:

>>> import pylab
>>> import numpy as np
>>> import pandas as pd
>>> names1880 = pd.read_csv('/root/yob1880.txt', names=['name', 'sex', 'births']) 
>>> pieces = [] 
>>> for year, group in names.groupby(['year', 'sex']):
...     pieces.append(group.sort_index(by='births', ascending=False)[:1000])
...     top1000 = pd.concat(pieces, ignore_index=True)
>>> table = top1000.pivot_table(rows='year', cols='sex', aggfunc=sum)
>>> table.plot(title='Sum of table1000 by year and sex',
     yticks=np.linspace(0, 1.2, 13), xticks=range(1880, 2020, 10))
Qt: Session management error: None of the authentication protocols specified are  supported
<matplotlib.axes.AxesSubplot object at 0x3063610>

我正在运行Kali Linux 1.0.7数据框看起来很好,我的代码运行正常,直到我尝试绘制它,所以为什么我每次都会收到错误,我尝试使用pylab.show()功能,它甚至没有绘制线?

1 个答案:

答案 0 :(得分:0)

看起来问题是Qt而不是Matplotlib。运行qtcreator或类似的东西会发生什么?如果失败了,你可能需要重建Qt。