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

panel.border() is ignored inside ggplotly()

Open dempsey-CMAR opened this issue 2 months ago • 0 comments

Since I updated ggplot2 to version 4.0.0, panel.border() is ignored when a ggplot is passed to ggplotly()

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)

dempsey-CMAR avatar Nov 07 '25 16:11 dempsey-CMAR