【发布时间】:2012-03-11 02:28:47
【问题描述】:
我正在尝试使用 ggplot2 创建箱线图,但无法像 ggplot2 网站示例中那样显示刻度。
这里有一些水果味道的假数据:
apples <- data.frame(fruit=c(rep("apple", 30)), taste=runif(30, 30, 50)
banana <- data.frame(fruit=c(rep("banana", 30)), taste=runif(30, 300, 500))
orange <- data.frame(fruit=c(rep("orange", 30)), taste=runif(30, 3000, 5000))
fruits <- rbind(apples,banana,orange)
如果我在ggplot2 website example 中绘制,y 轴刻度应该类似于:
相反,我得到一个像这样的轴:
ggplot(fruits, aes(fruit, taste) ) + geom_boxplot() + scale_y_log10()
如何获得科学计数法的 y 轴刻度?
【问题讨论】: