Open jvgogh opened 7 years ago
This also affects other geoms. Is there a plan to address this issue?
###Sample gaussian distributions with 1, 2 and 3 modes.
df <- data.frame(
"Distribution" = c(rep("Unimodal", 500),
rep("Bimodal", 250),
rep("Trimodal", 600)),
"Value" = c(rnorm(500, 6, 1),
rnorm(200, 3, .7), rnorm(50, 7, 0.4),
rnorm(200, 2, 0.7), rnorm(300, 5.5, 0.4), rnorm(100, 8, 0.4))
)
library(ggplot)
library(ggforce)
p <- ggplot(df, aes(Distribution, Value, color=Distribution))+ geom_sina() + geom_boxplot( outlier.alpha=0)
p
p %>% ggplotly()
Note also that the outliers are incorrectly printed (see the black dots) when they should be transparent and the legend is incorrect. Related: #1114
ggplot2:
plotly:
It seems the root issue here is some plotly.js traces are always drawn below other traces https://github.com/plotly/plotly.js/issues/3748
These examples should automatically fix themselves if and when plotly.js respects the ordering of traces...
Thanks for looking into this. Is the outlier printing issue something that would automatically be fixed, or it that different?
That's a different problem that I have more control over.
Rendering of violin plots with box plots (to provide median & stddev) is in wrong order when using ggplotly.
the ggplot (p) will render as expected with violin plots:![ggplot](https://cloud.githubusercontent.com/assets/5240097/22491081/e00fe67e-e7d5-11e6-84f7-62a5ff0b4154.png)
the ggplotly (q) will render with the box plot behind the violin plot (and larger than expected):![ggplotly](https://cloud.githubusercontent.com/assets/5240097/22491097/f3567446-e7d5-11e6-91eb-125879dfe314.png)