Make ggplotly respect override.aes in guide_legend
Open
Nobody has claimed this yet.
ggplotly
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
A short example:
library(ggplot2)
p <- ggplot(economics_long, aes(date, value01, colour = variable)) +
geom_line(size = .5) +
guides(colour = guide_legend(override.aes = list(size = 2)))
p
Notice the thicker lines in the legend on the right

However, this new element is ignored in ggplotly:
ggplotly(p)

This becomes even more critical when using a very low level of alpha, and then needing to adjust it for the legend.
Thanks.
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 R example with ggplot2 and ggplotly(p), comparing the ggplot2 and interactive legend results. Trace the ggplotly legend conversion entry point and verify that guide_legend's override.aes values, including size and alpha, affect the rendered legend.
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
- Clearly specified
- Newbie friendliness
- 38/100