Why doesn't Inkscape correctly read PDF files generated by R?
Asked Answered
G

1

6

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?

Grout answered 7/5, 2014 at 17:22 Comment(1)
Well, what happens if you change the defaults for pdf()?Trapan
W
6

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 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.

Went answered 7/5, 2014 at 18:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.