Skip to content

panel.border() is ignored inside ggplotly() #6734

@dempsey-CMAR

Description

@dempsey-CMAR

I found a problem with: panel.border() being ignored when ggplot is passed to ggplotly()

I expected: a red border around the plot panel in the ggplotly output, but there is no border.

In older versions of ggplot2 (v3.5.2), the border appears as expected.

Here is the code to reproduce the bug:

library(ggplot2)
library(plotly)

df <- data.frame(x = c(1:10), y = c(1:10))

p <- ggplot(df, aes(x, y)) +
  geom_point() +
  theme(panel.border = element_rect(color = 2, fill = NA))

ggplotly(p)

reprex::reprex()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions