![](/img/trans.png)
[英]How to accurately display SI prefix for numbers in y-axis scale of plot made with ggplot2 in R?
[英]R ggplot2 y-axis scale
你可以使用ylim()
library(ggplot2)
data(mtcars)
ggplot(data = mtcars,
aes(x = hp,
y = mpg,
color = cyl
)
) +
geom_point() +
ylim(min(mtcars$mpg) - 0.05, max(mtcars$mpg) + 0.05)
編輯:我忘了合並max(value) + 1
組件,現在包括了
嘗試這個:
+ scale_y_continuous(breaks = seq(min(value) - 0.05, max(value) + 0.05, by = 0.05))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.