我正在尝试生成一个包含数千个数据的条形图。
我对 ggplot 有尺寸问题。
代码 :
ggplot(data = df, aes(x=extension, y=duration)) +
geom_bar(stat="identity", width=10,fill="steelblue")+
ggtitle("Chart") +
xlab("Number") +
ylab("Duration") +
theme(legend.position = "none")+
theme(plot.title = element_text(hjust = 0.5), plot.subtitle = element_text(hjust = 0.5))+
coord_flip()
输出:
从 MongoDB 加载数据帧。数据框:
1 36952 7158803
2 36110 7068360
3 36080 4736043
4 36509 4726630
5 36890 4699026
6 36051 4698594
7 36783 4677233
8 36402 4672623
9 36880 4672093
10 36513 4655583
11 36522 4630962
12 36116 4628046
13 36746 4593291
....