python plot-索引字符串损坏

时间:2018-10-11 11:00:19

标签: python pandas jupyter-notebook

当我在python中绘制图形时,列字符串在jupyter中被破坏了。

lambdalist = [600, 300, 150, 75, 37.5, 18.75, 9.375, 4.6875]#, 2.34375, 1.171875]
data = np.array(w_check[3].tolist() + w_check[13].tolist()+ w_check[39].tolist()+ w_check[45].tolist()+ w_check[66].tolist()).T.tolist()

wchanges = pd.DataFrame(data, index=lambdalist, columns=['', '', '', '', ''])

wchanges.plot()

结果是

enter image description here

我如何正确打印平方的东西?

1 个答案:

答案 0 :(得分:2)

您的列名包含等宽字母。如果有意这样做,则可能需要将matplotlib字体系列更改为等宽字体:

matplotlib.rcParams['font.family'] = 'monospace'
相关问题