简单的.csv:
"","teamID","yearID","HR"
"1320","LAN",1958,172
"1325","SFN",1958,170
"1336","LAN",1959,148
"1341","SFN",1959,167
"1352","LAN",1960,126
"1357","SFN",1960,130
"1369","LAN",1961,157
"1375","SFN",1961,183
"1388","LAN",1962,140
"1395","SFN",1962,204
"1408","LAN",1963,110
"1415","SFN",1963,197
"1428","LAN",1964,79
"1435","SFN",1964,165
"1448","LAN",1965,78
我正在尝试绘制 2geom_line()
对应于 2 个团队(LAN
/ SFN
):
hr_by_team_year = pandas.read_csv("simple.csv")
print ggplot(hr_by_team_year, aes("yearID", "HR", color="teamID")) + geom_point()+ geom_line()
但我想画一个这样的图表:
根据绘制折线图。
我的代码有什么问题?