Skip to content

Customized legend symbols beyond key gliph #6188

@antoine4ucsd

Description

@antoine4ucsd

Hello
I am looking for ways to replace standard legend symbols by external icon/png or icon libraries

example below

myimage <- png::readPNG(here("images/img.png"))
ggplot() +
        geom_sf(data = df, aes(fill = case)) +
        ggimage::geom_image(data = df2, aes(x = lon, y = lat, image = myimage, size=count), 
                   color="black",show.legend = F) + 
        scale_size_continuous(range = c(0.03, 0.12)) 



the legend size is showing circles, not the the image used in the plot

thank you for your help!

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