thomasp85 / patchwork

The Composer of ggplots
https://patchwork.data-imaginist.com
Other
2.45k stars 161 forks source link

How to Collect Guides for All PCoA Plots? #371

Open timz0605 opened 1 month ago

timz0605 commented 1 month ago

Hello!

First of all, this is an awesome package, and thank you so much!

I constructed 6 ordination plots with my data, and I am trying to collect them together. However, although I have tried multiple attempts, I am having trouble collecting the guides for all 6 plots, although they use the same legend. I was wondering if anyone could help take a look at this issue?

Thank you!

(p_106_bray + p_500_bray + p_sessile_bray + 
  p_106_jaccard + p_500_jaccard + p_sessile_jaccard +
  plot_layout(ncol = 2, byrow = FALSE, guides = "collect")) & 
  theme(legend.position = "bottom")

image

thomasp85 commented 3 weeks ago

The guide collecting is very picky with the similarity of the guides that are removed. They are only removed if they are exactly correct.

If you can create a minimal example that shows the failing I'll be happy to look into whether it is some problem in your code or if patchwork is running afoul