ggplotly does not display geom_errorbar legend keys
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
It drops off the keys in the legend.
library(dplyr)
library(ggplot2)
library(palmerpenguins)
plot_data <- penguins %>%
group_by(sex, species) %>%
summarise(middle = median(body_mass_g, na.rm = TRUE),
lower = quantile(body_mass_g, probs = 0.25, na.rm = TRUE),
upper = quantile(body_mass_g, probs = 0.75, na.rm = TRUE))
p <- ggplot(plot_data) +
geom_errorbar(aes(x = sex, ymin = lower, ymax = upper, col = species))
plotly::ggplotly(p)

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the reproducible R example in the issue and inspect the ggplotly conversion of the geom_errorbar layer. Done means the resulting plot displays the expected legend keys for the error-bar traces.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100