ggplotly() 覆盖了一些 ggplot theme() 参数。有谁知道如何阻止这个?

ggplotly() is overriding some ggplot theme() arguments. Does anyone know how to stop this?

基本上我希望我的情节背景与元情节颜色相同,当我使用 ggplotly() 包装器时不会执行。有(第一)和没有 ggplotly 的图像。代码如下:

#ggplotly(
        df %>%
        filter(!is.na(Boxoffice)&!is.na(Decade))%>%
        ggplot(aes(x=Boxoffice,y=IMDb.Score))+
        geom_point(aes(text=Title),size=2,alpha=0.3,color = "#DB5461")+
        theme_aes()+
        facet_wrap(~Decade)+
        theme_aes()+
        theme(plot.background = element_rect(fill="#f0f0f0",color="#b4b4b4"))
        #)

再次从 plot_ly 对象中删除背景;

library(tidyverse)
library(plotly)


iris %>%
ggplot(aes(x=Sepal.Width,y=Sepal.Length))+
geom_point(size=2,alpha=0.3,color = "#DB5461")+
facet_wrap(~Species)+
theme(plot.background = element_rect(fill="#f0f0f0",color="#b4b4b4"),panel.background = element_blank()) -> ggobj

plotlyobj <- ggplotly(ggobj)


ggobj

plotlyobj %>%layout(plot_bgcolor='rgba(0,0,0,0)')