【发布时间】:2016-04-22 16:21:55
【问题描述】:
我在更改 y 轴值时遇到了一些问题。
这是我的 df:
Years <-c("1997","1997","1997", "1998","1998","1998", "1999", "1999","1999","2000", "2000", "2000")
Type <-c("Export","Import", "Production","Export","Import", "Production", "Export","Import", "Production","Export","Import", "Production")
Amount <- c(12063595,19465000,38591914,14929732,20941620,42570725,33598846,30533486,62633597,39755626,30129958,49493053)
df <-data.frame(Years, Type, Amount)
这是我制作的图表:
ggplot(data=df, aes(x=Years, y=Amount, group=Type, colour=Type)) +
geom_line(size=1.1) +
scale_colour_manual(values=cbPalette)+
theme_bw()+
ylab("Timber [in 10,000 m3(r)]") +
xlab("Years") +
expand_limits(y=0) + guides(colour = guide_legend(override.aes = list(size=3)))+
theme(legend.title=element_blank(),
legend.position="top",
legend.text = element_text(size=20),
axis.text.x = element_text(size=20), axis.title.x=element_text(size=20),
axis.text.y = element_text(size=20), axis.title.y=element_text(size=20))
如您所见,我的数字非常高(最高 = 62,633,597),现在它们以科学的方式显示(6e+07)。 我想显示标签中指示的“万”值,但我完全不知道是否有办法做到这一点。
【问题讨论】: