为什么图形线不显示在 Matplotlib 中

时间:2021-03-03 11:44:20

标签: python matplotlib

我刚刚开始学习 matplotlib,我可以看到我的图表,但我看不到我的图表线

import pandas as pd
import matplotlib.pyplot as plt
file=pd.DataFrame(
    {
        'Language': ["Assembly", "C++", "Java", "C", "Python", "Php", "Ruby", "Java"],
        'Date': ['1-1-2008', '1-1-2009','1-1-2010', '1-1-2011', '1-1-2012', '1-1-2013', '1-1-2014','1-1-2015'],
        'Cool': [1, 2, 3, 4, 5, 6, 7, 8]
    }
)

pivot = file.pivot(index='Date', columns='Language', values='Cool')
plt.figure(figsize=(16,10))
plt.xticks(fontsize=14)
plt.yticks(fontsize=14)
plt.plot(pivot.index, pivot.Java)

0 个答案:

没有答案