Sharpie / RTikZDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.
32 stars 36 forks source link

Deal with negative width and height in raster routines. #53

Closed Sharpie closed 12 years ago

Sharpie commented 12 years ago

R will pass negative widths and heights to the raster routine if the axes of a plot are reversed, for example specifying a decreasing xlim:

tikz(standAlone = TRUE)
image(volcano, xlim = c(1,0), useRaster = TRUE)
dev.off()

This will fail because the raster routines in the tikzDevice expect width and height to be positive numbers.

Sharpie commented 12 years ago

Also worth noting that not every device handles this situation in the same way. For example, Quartz has several different interpretations depending on if the output is going to the screen or to a PDF.

The tikz device should behave the same as the pdf device.