-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
@teunbrand I could not find an open issue on this, but I remember seeing a rather recent commit by you implementing this new feature. In 3.4.4.9000 I see it working in annotate() and in aes() but not with values mapped to constants in calls to geoms (at least geom_label()). By the way, it is great to see this implemented in 'ggplot2'. It makes several geometries in 'ggpp' redundant which is, I think, an indication of usefulness, as now all geometries become usable with NPC coordinates.
library(ggplot2)
ggplot(data = mtcars,
mapping = aes(x = disp, y = mpg, colour = factor(cyl))) +
geom_point() +
annotate(geom = "label", x = I(0.5), y = I(0.9), label = "a label")ggplot() +
geom_point(mapping = aes(x = disp, y = mpg, colour = factor(cyl)),
data = mtcars) +
geom_label(mapping = aes(x = I(x), y = I(y), label = label),
data = data.frame(x = 0.5, y = 0.9, label = "a label"))ggplot(data = mtcars,
mapping = aes(x = disp, y = mpg, colour = factor(cyl))) +
geom_point() +
geom_label(x = I(0.5), y = I(0.9), label = "a label", colour = "black")ggplot(data = mtcars,
mapping = aes(x = disp, y = mpg, colour = factor(cyl))) +
geom_point() +
geom_label(x = 300, y = 32, label = "a label", colour = "black")Created on 2024-01-22 with reprex v2.1.0
Metadata
Metadata
Assignees
Labels
No labels



