Remove blank lines from plot geom_tile ggplot

前端 未结 1 1029
感动是毒
感动是毒 2020-12-18 15:33

Is there a way to remove the blank lines from a geom_tile plot? If I try scale = \"free\" it looks weird. I want to preserve the width and height of each facet.

相关标签:
1条回答
  • 2020-12-18 15:56

    You should add argument scales="free_y" to facet_wrap() to remove "empty" lines.

     +facet_wrap(~Group,ncol=1,scales="free_y") 
    

    If you need to have the same width of tiles after removing the "empty" lines then use facet_grid() instead of facet_wrap() with argument space="free".

     +facet_grid(Group~.,scales="free_y",space="free") 
    
    0 讨论(0)
提交回复
热议问题