plotly.R icon indicating copy to clipboard operation
plotly.R copied to clipboard

ggplotly does not show point size legend for geom_point

Open HenriettaHolze opened this issue 2 years ago • 1 comments

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.

HenriettaHolze avatar Jul 26 '22 21:07 HenriettaHolze

I realized that bubble charts in plotly also don't have a size legend as described in #705. Is there any update on this?

HenriettaHolze avatar Jul 27 '22 05:07 HenriettaHolze