在ggplot中为不同的分面分别设置y轴

25

我想使用ggplot创建一个图形,其中不同的面板应具有不同的y轴限制。默认情况下,每个面板具有相同的y轴值。是否可以以某种方式进行更改?


2
在 facet 中的 scales 参数 - TheComeOnMan
2个回答

27
你可以将scales改为"free_y"。
  facet_grid(facets, margins = FALSE, scales = "fixed",
    space = "fixed", shrink = TRUE,
    labeller = "label_value", as.table = TRUE, drop = TRUE)

更多细节和示例,请参见:https://ggplot2.tidyverse.org/reference/

11

参见?facet_grid。你需要使用参数scales="free_y"


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接