【发布时间】:2020-04-06 10:19:43
【问题描述】:
我希望将 4 个类别(欧盟、日本、北美和其他)的销售额排名前 20 位的游戏绘制在一个情节上。
我使用下面的代码为每个排名前 20 名:
# creating a scatterplot of the top 20 in each category
top20NA <- head(sort(games$NA_Sales,decreasing=TRUE), n = 20)
top20EU <- head(sort(games$EU_Sales,decreasing=TRUE), n = 20)
top20JP <- head(sort(games$JP_Sales,decreasing=TRUE), n = 20)
top20other <- head(sort(games$Other_Sales,decreasing=TRUE), n = 20)
然后我尝试运行下面的块,但它似乎只运行最后一个情节:
plot(top20NA, col ="Blue")
plot(top20EU, col = "Black")
plot(top20JP, col = "Yellow")
plot(top20other, col = "Green")
x 轴应该是排名,y 轴应该是销售额
有什么想法吗?提前致谢
【问题讨论】:
-
使用
ggplot2stackoverflow.com/q/1249548/786542 可能会更容易
标签: r plot scatter-plot