Closed rcst closed 8 years ago
Hi,
Yes, this is a known issue. This package should solve it: https://github.com/davidgohel/gdtools
However, there is an issue with the Windows version (and don't have a Windows computer actually). I think next week I will be able to work on solving this issue with a Win PC.
David
Hi David,
I'm using a windows machine, so I guess that's why I'm still getting this warning when having installed gdtools, resulting in the same plot missing the gradient colour bar legend.
Eric
Sorry, I was not clear. The new package should solve the issue but this new package is not integrated yet and has an issue with Windows.
David
Hi,
This is solved (with packages rvg
and gdtools
)
David
Thank you so much!
Hi David and Eric, Trying to use addPlot.pptx(..., vector.graphic = TRUE) function with a scale_fill_gradient in my ggplot I have the same problem so I'm very interested to know how does it work for you?
`library(ReporteRs) library(ggplot2) library(dplyr) library(reshape2)
p <- ggplot(melt(data.frame(mtcars2)) %>% group_by(variable) %>% mutate(mean = mean(value)), aes(x = variable, y = value)) + geom_boxplot(aes(fill=mean)) + scale_fill_gradient(low=hcl(0,100,75), high=hcl(195,100,75))+ theme(text = element_text(size=16), axis.text.x = element_text(face="bold", angle = 90, hjust = 1), axis.text=element_text(size=20),legend.text=element_text(size=16),legend.title = element_text(size=16, face="bold"))+ xlab("variable")
mydoc <- pptx(title = "Test PPT") mydoc <- addSlide(doc = mydoc, "Title and Content") mydoc <- addPlot(doc = mydoc, fun = print, x = p, vector.graphic = TRUE) writeDoc(doc = mydoc, "TestPPT.pptx") `
Warning message: In grid.Call.graphics(L_raster, x$raster, x$x, x$y, x$width, x$height, : raster rendering is not implemented for this device
PS : I'm using a windows machine.
Thanks
Ali
Hi Ali,
I think you are not using the github version. This new version support raster rendering.
David
Hi David,
I also would like to thank you for having created such a nice package, I enjoy working with it alot.
I found that addPlot.pptx(..., vector.graphic = TRUE) has a problem when printing a ggplot2 plot-object with continuous colour mapping. See example below:
The resulting graphic in the pptx-file looks like this:
... which in PowerPoint is not editable and the colour scale is missing in the legend.
Here is the output of sessionInfo():
Do you know what's the issue with it, or am I mistaking something?