【发布时间】:2021-03-30 10:00:57
【问题描述】:
嗨,我是编码新手,我一直在关注如何在 RStudio 中制作圆形条形图的 youtube 教程。问题是我使用的数据高达数千万,并且希望放大 y 尺度以更详细地查看数据。我尝试使用coord_cartesian 并设置ylim,但没有任何变化并得到消息“坐标系已经存在”
如何将 y 比例更改为 40,000,000 到 70,000,000 之间?
这就是我所拥有的
#create data
month <- c('Mar 19', 'Apr 19', 'May 19', 'June 19', 'Jul 19', 'Aug 19', 'Sept 19','Oct 19', 'Nov 19', 'Dec 19', 'Jan 20', 'Feb 20')
rides <- c(67583312, 59590909, 68449486, 60163410, 63675286, 66059525, 63148128, 66208467, 65481522, 58539077, 57098170, 60289465)
df=data.frame(month,rides)
df
ggplot(df,aes(x=month,y=rides, fill=month))+
geom_bar(stat='identity')+
theme(legend.position = "none")+
coord_cartesian(ylim(40000000, 70000000), clip = "on")+
coord_polar(start=0)
【问题讨论】: