Increase the width of one plot in multiple plots
2
1
Entering edit mode
6 months ago
G.S ▴ 60

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 • 515 views
ADD COMMENT
3
Entering edit mode
6 months ago
zx8754 12k

Another relevant package for custom layouts patchwork

ADD COMMENT
2
Entering edit mode
6 months ago

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.

ADD COMMENT
1
Entering edit mode

Thanks for your help

ADD REPLY

Login before adding your answer.

Traffic: 1930 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6