Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geom_boxplot() improvements #1514

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

geom_boxplot() improvements #1514

wants to merge 6 commits into from

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Apr 9, 2019

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 cpsievert mentioned this pull request Apr 11, 2019
2 tasks
@cpsievert
Copy link
Collaborator Author

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

@vcmorini
Copy link

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

@dingying85
Copy link

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.

@cpsievert
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grouped boxplot data not centred on xaxis ticks, looses boxgap argument, and wont resize with subplots
3 participants