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

geom_boxplot() improvements

Open cpsievert opened this issue 5 years ago • 4 comments

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

cpsievert avatar Apr 09 '19 21:04 cpsievert

This should wait until we upgrade to plotly.js 1.52, then we can use the new 'pre-computed' feature of the box trace.

cpsievert avatar Jan 08 '20 19:01 cpsievert

Hello, would you know how we can apply these changes in the python library? Thank you

vcmorini avatar Apr 20 '20 10:04 vcmorini

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

dingying85 avatar Oct 26 '20 23:10 dingying85

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

cpsievert avatar Feb 21 '21 17:02 cpsievert