如何解决您可以将具有透明背景的 gt() 表另存为 png
嗨,我想知道是否有办法保存使用 gt 包创建的表格并用作具有透明背景的图像?
下面是一些示例代码,用于创建一个 gt() 表并将该表保存为 png,但不透明
filter((Sepal.Length==5.1 & Species=='versicolor')) %>%
select(Sepal.Length,Sepal.Width,Petal.Length,Petal.Width) %>%
gt() %>%
tab_spanner(label = "Sepal",columns = vars(Sepal.Length,Sepal.Width)) %>%
tab_spanner(label = "Petal",columns = vars(Petal.Length,Petal.Width)) %>%
tab_options(
table.background.color = "transparent",column_labels.font.size = 10.5,table.font.size = 10,heading.title.font.size = 24,heading.title.font.weight = 'bold',heading.subtitle.font.size = 11,table.font.color = 'white',table.border.top.color = "#0D2549",data_row.padding = px(2),footnotes.font.size = 8,source_notes.font.size = 9,footnotes.padding = px(1),) %>%
opt_table_font(
font = list(
google_font("Chivo"),default_fonts()
)
) %>%
gtsave("Image Name.png")
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。