0

I am using R and tikzdevice to export a ggplot2 drawing to a tikz drawing. The drawing consists of a raster layer for Germany and a shapefile for the country borders. The raster layer is saved as a png and linked to in the tikz file.

As long as I only use the raster layer, tex can compile the drawing, but as soon as I add the shape layer, tex runs out of memory. Apparently there is way to much information in the shapefile, but I have no idea how to compress it.

Is it possible to dynamically link to the png file? If I put the tikz-tex file and the png in a subfolder and integrate it into a main document, the tikz file searches for the png file in the main folder instead of the subfolder?

Thanks in advance

telegott
  • 196
  • 1
  • 10
  • You could simplify borders in the shape file using `rgeos:::gSimplify`. – Roman Luštrik Feb 04 '15 at 09:18
  • Thanks alot! I wasn't really able to convert the resulting spatial lines object to a spatial lines dataframe again, so I went for the option to rasterize the shapefile, which worked. Had to use imagemagick though to enable PNG transparency. – telegott Feb 10 '15 at 00:00

0 Answers0