【发布时间】:2020-04-21 16:17:49
【问题描述】:
根据下面的例子,如何使图表的 y 轴显示从 25 到 25 的值?
输入代码:
library(ggplot2)
# scatter plot
graph <-ggplot(cars, aes(x = speed, y = dist)) +
geom_point() +
ylim(0,150) +
xlim(0,30) +
labs(y = 'y-axis', x = "x-axis") +
theme_classic()
graph
我阅读了几个教程,但找不到此功能。以下是我阅读的一些教程链接:
https://ggplot2.tidyverse.org/reference/lims.html
https://ggplot2.tidyverse.org/reference/coord_cartesian.html
https://ggplot2.tidyverse.org/reference/lims.html
http://www.sthda.com/english/wiki/ggplot2-axis-scales-and-transformations
https://ggplot2-book.org/scales.html
[其他一些...]
【问题讨论】: