plotly.R
plotly.R copied to clipboard
geom_boxplot() improvements
This changes the default behaivor of ggplotly() to render geom_boxplot()
as low-level polygons rather than plotly.js box traces. As result, we'll be able to exactly replicate the ggplot2 result in many more cases. A list of relevant issues this PR should close: #1484, #1241, #1114, #1098, #866, #697, #706
BTW, for those who want the old-behavior (which one might want in order to keep the tooltip behavior the same), you can change geom_boxplot()
to geom_boxplot2()
TODO:
- [ ] Lots of visual tests
This should wait until we upgrade to plotly.js 1.52, then we can use the new 'pre-computed' feature of the box trace.
Hello, would you know how we can apply these changes in the python library? Thank you
Hi,
Regarding #697, it seems that problem is still there, when plot two subgroup boxplots side by side, if one group only have 1 subgroup data available, then the dots are not aligned.
I also noticed that this throw an error when you consider #1603
> library(plotly)
>
> plot <- ggplot(diamonds, aes(cut, price)) +
+ geom_boxplot() +
+ scale_y_continuous(trans = "sqrt", limits = c(0, 25000))
>
> ggplotly(plot)
Error in mm2pixels(convert(u, "mm")) : Unit must be in millimeters