0

I am looking for ways to reconfigure ggbiplot plots to match each other. I know that plots are scaled differently to 'fit' the data behind the plot but I wondered if anyone has any advice on how to make plots match.

I used ggarange to make this mutliplot output:

ggarrange(p1,p2,p3,p4,
          labels = c("A", "B", "C", "D"),
          ncol = 2, nrow = 2)

As an example one of the ggbiplots code is here:

p2 <- ggbiplot(colour30.pca,ellipse=TRUE, groups = colour30$Trait.Feed.Mech., 
               obs.scale = 2, var.scale = 1, labels.size = 4, varname.size = 5)+
      theme_bw()+
      theme(legend.position = "bottom") +
      theme(legend.text=element_text(size=10)) +
      guides(colour = guide_legend(nrow = 3)) +
      scale_colour_npg(name="Feeding Mode (>30 Obs.)") +
      xlab ("PC1 (37.4%)")+ 
      ylab ("PC2 (18.0%)")

Below is the output that I would like to neaten up if possible

output plot I would like to neaten up

1 Answers1

0
  • The patchwork package can be used e.g. to align the axes all plots within a particular row or column
  • Sometimes, the aspect ratio of a plot is fixed with coord_fixed so they do not fill up all the space
  • Legends can be combines (e.g. patchwork::wrap_plots(guides = "collect"))
  • Apply the same theme to all plots to unify font sizes etc.
danlooo
  • 10,067
  • 2
  • 8
  • 22