I am using ggplot2 to create a heatmap, and am grouping my y variable by a categorical variable using facet_grid(). My y variables are genes of interest, and I am grouping them by their respective Pathways using facet_grid().
The pathway names are so long that I gave most of them acronyms, but want to use a legend to detail exactly what each acronym stands for.
How can I add a separate legend specifically for the variable I am calling in facet_grid()?
So far, everything I have found online tells me how to customize legends pertaining to the x or y variable - but I can't seem to find anything on how to create a legend specifically for the facet_grid() or facet_wrap() variables.
I already have a legend describing the color gradient in the heatmap, and do not want to lose this legend.
I have also included a screenshot of the kind of legend I'd like to make.
I have attached a screenshot of one of my heatmaps showing the facet_grid() labels - some of these labels are abbrevations that I want to explain in a legend.