在ggplot中为不同的面分开y轴

use*_*765 5 r ggplot2

我想用ggplot创建一个图,其中不同的facet应该有不同的y轴限制.默认情况下,每个构面都具有相同的y轴值.可以以某种方式改变吗?

Ste*_*cke 10

您可以scales改为"free_y".

  facet_grid(facets, margins = FALSE, scales = "fixed",
    space = "fixed", shrink = TRUE,
    labeller = "label_value", as.table = TRUE, drop = TRUE)
Run Code Online (Sandbox Code Playgroud)

有关更多详细信息和示例,请参阅:http://docs.ggplot2.org/0.9.3.1/facet_grid.html


Nic*_*ick 6

?facet_grid.你想使用这个参数scales="free_y".