Very often, I draw graphs in R and export them in pdf or svg. Then I import them in Inkskape or Illustrator. Sometimes this generates weird results. For instance, when I generate a simple scatterplot with shapes (1 and 16), Inkscape in unable to read it and generate the following file. See my gist file. I suspect that this should be due to the default options of the pdf()
graphics device but I'm not sure. Does anyone has a solution?
The PDF file format is a vector format that can also hold raster images. Inkscape can save directly to PDF. To do so, do File ‣ Save a Copy, and select Portable Document Format (*. pdf) from the list of available file formats at the bottom.
Inkscape's native format is Scalable Vector Graphics (SVG), but it can also open most types of image files, including PDF, JPG, GIF, and PNG. With the addition of free, downloadable extensions, Inkscape can also open PostScript, Sketch, CorelDRAW, and other proprietary image formats.
This is a symptom of different fonts being used as the plotting symbols. Try creating the PDF file using:
pdf("test.pdf", useDingbats = F)
plot(1:10, 10:1, pch=16 )
dev.off()
Screenshot from Inkscape
There is a long "Note" in ?pdf
about why the authors of R think some pdf viewers (apparently Inkscape being one such) are failing and some configuration suggestions which I have not tested on my Mac.
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