1

I have a question. I want to plot 2by2 or 1by1 graphs per page instead of 15 graphs on one page.

this is my code :

plot =   combine_core1_and_2_and_average[]%>%
    ggplot()+
    geom_boxplot(aes(x =merge_data_core1.depth, y = average,col = geno_pheno,))+
    ggtitle(title_name)+
    theme(legend.title = element_blank())+
    xlab("Depth (cm)")+
    ylab(title_name)+
    facet_wrap(.~cluster)

enter image description here

stefan
  • 90,330
  • 6
  • 25
  • 51
  • 2
    the `ggforce::facet_grid_paginate` function does exactly what you want. – Roman Aug 16 '21 at 13:21
  • Thank you so much, is it possible to make graphs automatically instead of changing paper numbers. – Ho Jun Jang Aug 16 '21 at 22:50
  • Of course. But you need to know how many pages you need in the end. Then you can try a for loop or sapply, lapplay or map. – Roman Aug 17 '21 at 07:20

0 Answers0