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
{{ message }}
Repository navigation
ggplot() does not display aesthetic in tooltip when aesthetic name == 'group' #2415
When converting a ggplot2 plot to plotly using ggplotly(), the generated tooltip does not contain aesthetic entry if its name is equal to 'group'.
Would it be like there are some 'reserved' word that can't be used as aesthetic names, in order for the tooltip generation to work correctly ?
Reproducible example
library(ggplot2)
library(plotly)
data(iris)
p1 <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, col = Species)) +
geom_point()
p1
ggplotly(p1, tooltip = "Species")
# => works fine!
iris2 <- iris
iris2$group <- iris2$Species
p2 <- ggplot(iris2, aes(x = Sepal.Length, y = Sepal.Width, col = group)) +
geom_point()
p2
ggplotly(p2, tooltip = "group")
# => does not show 'group' in tooltip
ggplotly(p2, tooltip = "all")
# => shows 'Sepal.Length' and 'Sepal.Width', but not 'group' in tooltip
Activity
Fix #2415: variable named 'group' now shown in tooltip when mapped to…
Fix #2415: variable named 'group' now shown in tooltip
Fix #2415: variable named 'group' now shown in tooltip
Fix multiple ggplotly() regressions (#2469)
phauchamps commentedon Jan 20, 2026
Thank you @cpsievert 👍