How to combine multiple plots in R with cowplot and ggplot2 (CC098)

Поделиться
HTML-код
  • Опубликовано: 4 окт 2024

Комментарии • 35

  • @Riffomonas
    @Riffomonas  3 года назад +2

    If you aren't using tools like cowplot or patchwork, what do you use to assemble multipanel figures?

    • @RasmusKirkegaard
      @RasmusKirkegaard 3 года назад +3

      I have also used gridExtras grid arrange function

    • @patschloss3342
      @patschloss3342 3 года назад

      @@RasmusKirkegaard cool - I’ll have to check that out

    • @Narya456
      @Narya456 3 года назад +1

      I often use ggarrange() from ggpubr which is a wrapper around this function, I think. But I didn't know about the rel_widths argument, this is quite useful. Thanks!

  • @senevi
    @senevi 3 года назад +2

    Doing my MSc Project about microbiome in the salmon gills and you're help is keeping me sane

    • @Riffomonas
      @Riffomonas  3 года назад +1

      Wonderful! It’s keeping me sane too 😂

  • @rajeshshigdel1472
    @rajeshshigdel1472 2 года назад +1

    Thanks a lot, your explanations were really useful

    • @Riffomonas
      @Riffomonas  2 года назад

      Wonderful- thanks for watching!

  • @PaulYoung-r8g
    @PaulYoung-r8g Месяц назад

    This was great. Thank you :)

    • @Riffomonas
      @Riffomonas  Месяц назад

      My pleasure! thanks for watching🤓

  • @romulocenci6176
    @romulocenci6176 3 года назад +1

    useful package and video, thanks a lot

    • @Riffomonas
      @Riffomonas  3 года назад

      Thanks! Glad you enjoyed the episode 😊

  • @method341
    @method341 3 года назад +3

    Wow this is some great content. Liked & subscribed for more!

  • @dudwx
    @dudwx Год назад

    how a guy with 62k citation is putting out this type of impressive educational content?! Amazing..

    • @Riffomonas
      @Riffomonas  6 месяцев назад

      Thanks - I do it because I think this will have more impact 🤓

  • @ieliemielio
    @ieliemielio 3 года назад +1

    Wish I’d seen this video earlier! Can you cover leaving out duplicate axes?

    • @Riffomonas
      @Riffomonas  3 года назад

      Thanks for the suggestion, I'll be sure to include it in a future episode. For now, perhaps using facet_wrap or facet_grid with the scales argument might suit your needs? I covered these in a previous episode here- ruclips.net/video/rBHNNApVFho/видео.html

    • @ieliemielio
      @ieliemielio 2 года назад

      @@Riffomonas cheers for the suggestion. It came up writing a paper recently, where we wanted to depict modelling results in multiple graphs sharing an x axis but with different y axes, and vice versa.

  • @nabana8205
    @nabana8205 2 года назад +1

    thank you so much

    • @Riffomonas
      @Riffomonas  2 года назад

      My pleasure- thanks for watching!

  • @jopwonya
    @jopwonya 2 года назад +1

    Thanks for the illustrations. In the published article, you have mean and standard deviations in the legend. How do I add the values to each plot?

    • @Riffomonas
      @Riffomonas  2 года назад +1

      Thanks for watching! You’d need to insert the values into the labels using paste or glue

  • @gambu4810
    @gambu4810 3 года назад +2

    Why didn't I meet you while I was doing my dissertation? 🤦🏾‍♂️

    • @Riffomonas
      @Riffomonas  3 года назад +1

      Sorry! :) At least you can do things a bit easier going forward in your career, right?

  • @haffkrugentertainment
    @haffkrugentertainment Год назад

    Is it possible to include normal pictures as one of the figures? So for example, I want to include a picture of a bacteria as subfigure A.

  • @edwardkellaway7651
    @edwardkellaway7651 3 года назад +1

    Wish I saw this video sooner!
    Longshot question....
    I am currently working up a figure with 6 facet wrapped bar graphs which I have put into a 2row x 3column cowplot using plot_grid.
    All of my x-axis labels are the same (Wetland types) and I am finding them to take up too much space in my figure.
    Is there a way to remove the x-axis labels and title from the first row and leave them in the second?
    I tried removing the x-axis labels and titles in my plot codes of the plots in the first row (which I inputted to plot_grid) but I kept getting the error "error: no method for merging function into element_text".
    Thanks.

    • @Riffomonas
      @Riffomonas  3 года назад

      Hey Edward - do you maybe want to use ggplot2::facet_grid instead? That should give you a common x and y-axis

  • @CasperLind1
    @CasperLind1 2 года назад +1

    I've tried to make to plots with a function like you did and nothing showed up..

    • @Riffomonas
      @Riffomonas  2 года назад

      Hi Casper - it’s hard for me to say. But if you run the code within the function does it create the figure? Maybe it’s not getting exported from the figure

  • @r_tools4063
    @r_tools4063 Год назад

    I am getting stripchart() instead of strip_chart and there is a problem in graph arrangement as in the first row and first column the place is empty. I have no idea How to fix this even the cowplot and gridgraphic are installed in R. there are a total of 3 graphs to be placed together.

  • @chooby364
    @chooby364 Месяц назад

    I dont like my axis labels to repeat themselves. Is there a way to have a single centered x and or y labelling. Been trying to figure it out but cannot manage to get it rght

    • @Riffomonas
      @Riffomonas  Месяц назад +1

      This type of thing is much easier using the {patchwork} package. Thanks for watching!

  • @hindi_recap1
    @hindi_recap1 2 года назад +1

    can we plots 2 plots from different libraries ?

    • @Riffomonas
      @Riffomonas  2 года назад

      If you look at the vignettes in the cowplot and patchwork documentation I believe they show how to combine different plotting systems