这是我的主题
theme(
text = element_text(size = 14, color = "white"),
axis.text = element_text(size = 10, color = "white", face = "bold"),
axis.text.y =element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
plot.background = element_rect(fill = "transparent",colour = NA),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
panel.background = element_rect(fill = "transparent",colour = NA),
plot.margin = unit(c(1, 1, 1, 1), "lines"),
legend.text = element_text(size = 10,
color = "white",
face = "bold",
margin = margin(l = 0.25, unit = "cm")
),
legend.title = element_blank(),
legend.background = element_rect(fill = "transparent",colour = NA)
)
ggplotly(plot)
一切都按预期进行,我可以使用所有颜色,但当我将背景设置为透明时,我会得到白色背景。ggplotly不接受透明背景吗?
如果用替换透明,它能工作吗
"#RRGGBBAA"
(来自https://ggplot2.tidyverse.org/reference/aes_colour_fill_alpha.html)
你导出你的绘图是为了检查透明度吗?