ggplotly does not show point size legend for geom_point
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
When using ggploty on a geom_point plot the point size legend is not shown.
Minimal example to reproduce:
library(ggplot2)
library(plotly)
p <- ggplot(mtcars, aes(x = wt,
y = mpg,
size = qsec))
p <- p + geom_point()
ggplotly(p)
Expected output from ggplot:

Ouput of ggplotly:

It does, however, show the color legend.
p <- ggplot(mtcars, aes(x = wt,
y = mpg,
color = qsec))
p <- p + geom_point()
ggplotly(p)
Freshly installed R 4.2.1, plotly_4.10.0 and ggplot2_3.3.6.
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 minimal R example through ggplotly and compare its size legend with the color-legend example. Trace the ggplotly conversion of geom_point aesthetics; done means the generated plot shows a point-size legend while preserving the existing color-legend behavior.
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
- 38/100