Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 2
    Just a minor note, this works just as well with the non-manual scales
    – Max Gordon
    Commented Jul 10, 2013 at 13:36
  • 1
    Another note: there are issues with using scale_fill_manual instead of scale_colour_manual for filled shapes. To remedy this, it seems to be necessary to override the settings with guides(fill = guide_legend(override.aes = list(fill = ...))) as in this question: stackoverflow.com/questions/12488905/…
    – Unstack
    Commented Oct 12, 2015 at 17:01
  • Does not work for me, returns colours encodes as numbers must be positive
    – Marco
    Commented Oct 7, 2021 at 7:45
  • This has helped me get what I need, but how could the answer be modified to change the number of rows and columns in the legend.
    – spindoctor
    Commented Jul 12 at 15:57