guides(fill = guide_legend(reverse = TRUE))
Assuming that you're referring to the legend in ggplot2
. This is just reversing the order of the legend. See the last example:
What is the purpose of guides function and why do we put guide_legend inside the function for fill?
Additional adjustments for the legend, I guess.
fill
(instead of col
) is in there as it is the type of graph you are using.
The guides (the axes and legends) help readers interpret your plots. Guides are mostly controlled via the scale (e.g. with the
limits
,breaks
, andlabels
arguments), but sometimes you will need additional control over guide appearance. Useguides()
or theguide
argument to individual scales along withguide_colourbar()
orguide_legend()
.
From here: Function reference • ggplot2
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.