1

我已使用代码将图表保存到我的剪贴板

x = c(1:5)
y = c(1:5)
windows(504, 360) #opens a separate window with the size you want 
plot.new()
plot(x,y, bg = "transparent")#my graph has more information but this would work
savePlot("clipboard", type="wmf")

使用 RDCOMClient,我想将此图表添加到我打开的 Powerpoint 演示文稿中。

PP = PPT.Init(visible = FALSE, method = "RDCOMClient")
PP = PPT.AddTitleSlide(PP, title = "test")
PP = PPT. AddTextSlide(PP, text = "This text will be covered if the graph is in the wrong place")

presentation = PP$pres
slide2 = presentation[["Slides"]][[2]]

我知道我可以使用 PP = PPT.AddGraphicstoSlide(PP) 但这不允许进行相同的自定义。也就是说,它不会从我的情节中继承“bg ='透明'”效果;相反,它会制作一个白色方形背景,覆盖我在背景中编写的文本。我可以很容易地手动修复这个问题,但我将数百个图表生成到多个演示文稿中,并且希望它是自动化的。有没有办法将保存到剪贴板的 wmf 格式的图表粘贴到正确幻灯片上的 powerpoint 演示文稿中?谢谢您的帮助

4

0 回答 0