Skip to content

Wrong order of layers from ggplot #2172

@rgaiacs

Description

@rgaiacs

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions