Skip to content

No dashed or dotted grid lines with ggplotly #1536

Open
@bjoernbos

Description

@bjoernbos

It seems that ggplotly cannot handle dashed or dotted grid lines. They always default to solid grid lines.

No matter whether I am specifying the general option panel.grid or a specific one like panel.grid.major.y, they always become solid with ggplotly.

library(ggplot2)
library(plotly)

# Dotted and dashed grid lines appear with ggplot2
p <- ggplot(mtcars, aes(disp, mpg)) +
  geom_point() +
  theme(panel.grid = element_line(colour = "red",
                                  linetype = "dotted")) # same issue if "dashed"

p

# However, with ggplotly they become solid
ggplotly(p)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions