在ggplot2中为每个x轴构面定义比例

时间:2018-08-13 09:31:24

标签: r ggplot2

如何为ggplot2中的构面定义x轴比例。例如,要为vs 1和vs 0定义xscale。我已经使用scales = "free_x"来使x标度自由,但是如何定义范围?

df <- mtcars 
ggplot(df, aes(y = disp, x = hp)) + geom_jitter() + 
  facet_wrap( .~ vs, scales = "free_x" )+
  #geom_blank(data=dummy2)+
  theme_classic() +
  theme(panel.spacing.x=unit(0, "lines"),panel.spacing.y=unit(0, "lines"),
        strip.text.x = element_blank()) 

0 个答案:

没有答案
相关问题