代码之家  ›  专栏  ›  技术社区  ›  Rodolphe LAMPE

如何将两个ggplot与一个旋转ggplot合并?

  •  0
  • Rodolphe LAMPE  · 技术社区  · 8 年前

    如何组合两个ggplots g1和g2,一个在左侧,另一个在右侧,旋转90°(仅右侧)?

    1 回复  |  直到 8 年前
        1
  •  1
  •   Axeman    8 年前

    width height 第二个情节,但这似乎奏效了:

    p <- qplot(1:10)
    
    library(grid)
    grid.newpage()
    print(p, vp=viewport(0, 0, width = unit(0.5, "npc"), just = c('left', 'bottom')))
    print(p, vp=viewport(0.5, 0, angle = 90, height = unit(0.8, "npc"), width = 0.55, just = c('left', 'top')))
    

    enter image description here