tomwenseleers / export

R package for streamlined export of graphs and data tables.
192 stars 35 forks source link

PPTX files from graph2ppt end up corrupt #54

Closed ThomasR099 closed 6 months ago

ThomasR099 commented 7 months ago

When using graph2ppt to export the following, it seems to go through fine in R, but the files are always corrupt and ppt is unable to repair them. I am saving them to a onedrive directory if that matters.

`ggplot(LeafTemp2022SubsetNight, aes(x=Tamb, y=deltaT, group=interaction,color=treatment)) +

geom_boxplot(position = position_dodge2(preserve = "single"))+

geom_point(shape=".",position=position_jitterdodge(jitter.width = 0.1 ,jitter.height = 0.1,dodge.width =0, seed = NA ),pch=20,size=0.02)+ geom_smooth(se=TRUE,level=0.95,method="lm",aes(color=treatment))+ labs(title ="Temperature differential leaf minus ambient Night '22", y="°C")+ theme_prism(base_line_size = 0.5,border = TRUE, base_rect_size = 0.5)+

scale_colour_prism(palette = "winter_bright")+

theme(plot.title = element_text(hjust = 0.5))+ coord_cartesian(expand = FALSE,ylim = c(-4, 4))

graph2ppt( file = "leafTemp", width = 10, aspectr = sqrt(2), append = TRUE`

image

tomwenseleers commented 6 months ago

Does it work if you try graph2ppt( file = "leafTemp.pptx", width = 10, aspectr = sqrt(2), append = FALSE) ?

ThomasR099 commented 6 months ago

That seems to do the trick; i'm assuming it's a memory thing due to the very high number of datapoints in the figure perhaps. Thanks for the quick response!