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

Wrong order of layers from ggplot

Open rgaiacs opened this issue 3 years ago • 0 comments

The output that I get from ggplot is

violim+boxplot-ggplot2

and from plotly is

violin+boxplot_plotly

With plotly, the boxplot is behind the violim chart.

The minimal working example that create the above images:

library(tidyverse)
library(plotly)

figure2b <-
  iris |>
  ggplot(aes(x=Species, y=Petal.Length)) +
  geom_violin(aes(fill=Species)) +
  geom_boxplot(width = 0.05) +
  labs(
    title='Iris',
    x="Species",
    y="Petal length",
  )

figure2b_plotly <- ggplotly(figure2b)

rgaiacs avatar Aug 18 '22 03:08 rgaiacs