Improper alignment of boxplots in facets
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
first of all, thanks for a great package!
I have spent some time with it recently and I think that I have found a bug. If I use boxplots and facets, the boxplots in the upper facet are on the left side of the category while the boxplots in the bottom facet are on the right side of the category, while I believe that they should be aligned in the middle. Picture tells more than thousands words, so see bellow...
you can get it with the following code:
library(ggplot2)
library(plotly)
data.1 <- diamonds
data.1$set <- "set1"
data.2 <- data.1
data.2$set <- "set2"
my.data <- rbind(data.1, data.2)
p <- ggplot(my.data, aes(x=cut, y=price, fill= clarity))+
geom_boxplot()+
facet_grid(set ~ .)
ggplotly(p)%>%
layout(boxmode = "group")

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied ggplot2 and ggplotly reproduction, focusing on how faceted boxplots are converted and positioned. Recreate the example and verify that boxplots in both facets are centered on their categories while preserving grouped layout behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100