Skip to content

Easier way to add manual legend #6386

Open
@brunomioto

Description

@brunomioto

When I was trying to remake this plot:

Image

It's quite hard to create these legends as we are already using fill and color.

I know there some options, but I was thinking in a easier way. Something like:

df |> 
  ggplot(aes(x = value, y = categories))+
  geom_col()+
  add_legend(fill = "#d8d8d8", color = NA, name = "Dentro das terras indígenas")+
  add_legend(fill = NA, color = "#222222", name = "Fora das terras indígenas")

Could it be added to ggplot2, or to other package like legendry?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions