Closed
Description
I want to create a new glyph combining existing drawing functions. I would've expected adding them in a glob list would work. When implementing a custom geom and implementing the draw_key()
method the same error occurs.
library(ggplot2)
library(grid)
p <- ggplot(economics, aes(date, psavert, color = "savings rate"))
p + geom_line(key_glyph = \(data, params, size) gList(draw_key_path(data, params, size)))
#> Error in `gtable_add_grob()`:
#> ! `grobs` must be a single grob or a list of grobs, not a list.
p + geom_line(key_glyph = \(data, params, size) gList(draw_key_path(data, params, size), draw_key_point(data, params, size)))
#> Error in `gtable_add_grob()`:
#> ! `grobs` must be a single grob or a list of grobs, not a list.
Created on 2025-07-06 with reprex v2.1.1
Metadata
Metadata
Assignees
Labels
No labels