This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Increase the width of one plot in multiple plots

Hello,

I plotted some genes of varying lengths, but the L gene is the longest. I'm wondering if it's possible to increase the width of the L gene only in this plot

I used the following code for plotting:

      rsv_top_89 %>%   ggplot(aes(x = AAPosition, y = prop_ratio))+  
     geom_line(aes(color = Condition))+  geom_text(data = . %>% 
filter(prop_ratio > 0.045),nudge_y = 0.02, size=6,
             aes(label = RefSite), stat = "unique")+  

     facet_wrap(.~Protein, scales = "free_x", ncol = 2)+   

    scale_y_continuous(expand = expansion(mult = c(0,0.1)))+ 
       theme_bw(base_size = 18)+   scale_color_manual(
            values = c(
            "HRSV" = "#de2d26",
            "HRSV" = "#3182bd"
            )   )+ylab("Ratio")+ xlab("Amino acid position")+  
      theme(
            strip.clip = "on",
            legend.position = c(0.9,0.1),
            plot.margin = margin(10,10,10,10,"pt"),
            panel.grid.major.y = element_line(), base_size = 15,hjuts= -5
            #panel.grid.minor.y = element_line()   

enter image description here

r ggplot2

2 answers

Another relevant package for custom layouts patchwork

Yes, the cowplot package is your friend. You can probably also work with grid.arrange() alone for that simple layout, but cowplot is so convenient that I have switched entirely to it.

Thanks for your help

Log in to answer this question.