plotly / plotly/plotly.R

ggplotly does not show point size legend for geom_point

Open
#2,163 1 comment 0 reactions 0 assignees View on GitHub

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:
image

Ouput of ggplotly:
image

It does, however, show the color legend.

p <- ggplot(mtcars, aes(x = wt, 
                        y = mpg, 
                        color = qsec))
p <- p + geom_point()
ggplotly(p)
image

Freshly installed R 4.2.1, plotly_4.10.0 and ggplot2_3.3.6.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.