连接散点图

时间:2020-05-12 01:53:41

标签: python pandas matplotlib

对于此图,我需要帮助将点和线连接起来

enter image description here

这是我的代码:

country_stats.plot(kind='line',
                   x="GDP per capita",
                   y='Life satisfaction',
                   color='blue',
                   figsize=(8,3))
plt.axis([0, 110000, 0, 10])

1 个答案:

答案 0 :(得分:0)

尝试将style='.-'添加为country_stats.plot()的kwarg。

编辑:

鉴于您在colors中已经有pandas.DataFrame.plot(),请添加marker='.-'而不是style='.-'

相关问题