[英]Editable plots in PowerPoint from python: equivalent of officer and rvg
[英]What is the equivalent of officer::ph_location_fullsize( ) in the package rvg?
我想将多个可食用的地块和桌子从R导出到PowerPoint。
以下是我拥有的代码片段以及我正在使用的软件包:
library(ggplot2)
library(dplyr)
library(tidyr)
library(gridExtra)
library(grid)
library(officer)
library(rvg)
read_pptx() %>%
add_slide(layout = "Title and Content", master = "Office Theme") %>%
ph_with_vg(code = grid.arrange(plot, table, col = 1), type = "body") %>%
print(target = path)
在输出中,导出的图形和表格仅覆盖幻灯片的底部2/3。 如何修改我的代码,以便我尝试导出的内容可以占据整个幻灯片?
另一个问题:如果我想在幻灯片上添加标题,如何指定文本的对齐方式(首选),大小和颜色? 默认对齐方式是居中,但我还没有找到解决方法。
谢谢。
使用ph_location_fullsize()
,它将起作用。
library(officer)
library(magrittr)
library(rvg)
read_pptx() %>%
add_slide(layout = "Title and Content", master = "Office Theme") %>%
ph_with(value = dml(barplot(1:5)), location = ph_location_fullsize()) %>%
print(target = "test.pptx")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.