首页 > 解决方案 > 连通散点图

问题描述

我需要帮助将此图的点与线连接起来:

在此处输入图像描述

这是我的代码:

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

标签: pythonpandasmatplotlib

解决方案


尝试添加style='.-'as kwarg for country_stats.plot()

编辑:

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


推荐阅读