palaeoverse / rphylopic

Get Silhouettes of Organisms from PhyloPic
https://rphylopic.palaeoverse.org
GNU General Public License v3.0
91 stars 9 forks source link

Add phylopic_key_glyph #68

Closed willgearty closed 1 year ago

willgearty commented 1 year ago

This adds a custom key glyph function that can be used with geom_phylopic to specify silhouettes for the legend. image

Resolves #57.

willgearty commented 1 year ago

Note: I still need to figure out why one of the tests isn't making the correct snapshot.

willgearty commented 1 year ago

With the most recent commit, looks like this "just works" with the new fill/color split.

image

willgearty commented 1 year ago

This is the expected behavior for a ggplot legend (which should only represent the aesthetics). For example:

ggplot(df) +
    geom_point(aes(x = x, y = y, fill = name), color = c("blue", "red"), size = 10, shape = 21) +
    coord_cartesian(xlim = c(1,6), ylim = c(5, 30))
willgearty commented 1 year ago

OK, your two other requests/comments have been moved to separate issues for future development. I'll merge this once the checks pass!