在我的以下代码中:
library(ggplot2)
library(scales)
myData <- data.frame(
platform = c("Windows","MacOs","Linux"),number = c(27000,16000,9000)
)
ggplot(myData,aes(x = reorder(platform,-number),y = number))+
geom_bar(stat="identity",fill="darkturquoise",width = 0.5)+
geom_text(aes(label = number),vjust=-0.3)+
xlab("Platform")+
scale_y_continuous(breaks = round(seq(0,40000,by = 5000),1))
产生此图的
如何更改scale_y_continuous
的参数以减少000
的数量?即y勾号将显示5、10、15、20、25 ...