PCATools: is it possible to output a single legend when using pairsplot()?
1
0
Entering edit mode
oakhamwolf • 0
@oakhamwolf-24374
Last seen 11 months ago
UK

Hi all,

I'm currently loving the PCATools package, it is very neat and easily replaces my own comparatively crude efforts using ggplot2()

When producing a pairsplot() I was wondering if it was possible to output a single legend (top, bottom, right or left) to be used as a reference for all the individual biplots? Currently when using legendPosition = 'bottom' (for example), each biplot has its own legend, which is a bit redundant and also squishes all the biplots.

Many thanks.

PCATools • 305 views
1
Entering edit mode
@kevin
Last seen 3 hours ago
Republic of Ireland

For this, you'll have to plot each as a panel via cowplot::plot_grid() and make use of the rel_widths parameter. Or, it may even be easier to output each with the legend and do some post-editing outside of R.

Kevin

0
Entering edit mode

Great. I'll give it a go. If it's not already implemented in PCATools, is there a way to submit a feature request for a future version?Thanks again for putting PCATools together. Cheers

0
Entering edit mode

You can create an issue on the GitHub page, if you wish: https://github.com/kevinblighe/PCAtools