关于 r:ggplot2 y 轴刻度未显示在对数刻度上 | 珊瑚贝

ggplot2 y-axis ticks not showing up on a log scale


我正在尝试使用 ggplot2 创建箱线图,但无法像 ggplot2 webiste 的示例中那样显示刻度。

这里有一些水果味道的假数据:

1
2
3
4
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 网站示例中进行绘图,则 y 轴刻度应类似于:

enter

相反,我得到一个像这样的轴:

1
ggplot(fruits, aes(fruit, taste) ) +  geom_boxplot() + scale_y_log10()

enter

如何获得科学计数法的 y 轴刻度?




来源:https://www.codenong.com/9651903/

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_8700.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?