I would like to plot in R using an existing pdf file as the background. The reason I don't want to use another format (png, jpg, gif), is that I don't want to lose any quality of the image in my (already existing) pdf file. Any recommendations? Many thanks!
Thanks a lot tim riffe! I found the answer in that document:
First convert the pdf to ps. Then do the rest with the grImport package:
#convert the ps to xml:
PostScriptTrace("image.ps")
# store the xml info in RGML format (R Graphics Markup Language):
NLmap <- readPicture("image.ps.xml")
#plot the image
plot(etc...)
par(new=T)
plot(grid.picture(NLmap[-1]),etc...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With