You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, that doesn't work because default aesthetics are evaluated in isolation, not in context of the data. For that reason, the fill aesthetic cannot be found.
ggplot(mpg, aes(displ, hwy, fill = drv)) +
stat_identity(geom = GeomPointAlt)
#> Warning: Failed to apply `after_scale()` modifications to legend
#> Caused by error:
#> ! object 'fill' not found
#> Error: object 'fill' not found
BTW I don't know if this will complicate things a lot, but I think get_geom_defaults() which also errors on that line will need a special treatment since data = NULL. (or maybe asking for a "default" value for delayed aesthetics should just error/skip early as that may be kinda odd)
get_geom_defaults(GeomPointAlt)
#> Error: object 'fill' not found
This was brought to my attention by @larmarange.
Hypothetically, one could want to automate making the following plot, by setting the default
colour
aesthetic in the geom.To do so, it does not seem unreasonable to make
colour = after_scale(alpha(fill, 0.4))
part of theGeom$default_aes
field.However, that doesn't work because default aesthetics are evaluated in isolation, not in context of the data. For that reason, the
fill
aesthetic cannot be found.Created on 2024-10-11 with reprex v2.1.1
The relevant line is indicated below, and I think we only need to add a
data = data
to thelapply()
.ggplot2/R/geom-.R
Line 139 in ddd207e
The text was updated successfully, but these errors were encountered: