Closed krlmlr closed 8 years ago
I'm pretty sure this is caused by tikz_writeRaster()
opening a new PNG device for creating a PNG file. It might be that the graphics code isn't fully reentrant in this particular use case. I'll try changing this to png::writePNG()
, let's hope the image differences won't be too large.
@yihui: I'm not really familiar with recording and replaying of plots. The tikzDevice creates an auxiliary PNG file for each raster grob, through the C function TikZ_Raster()
which calls the R function tikz_writeRaster()
. Do you think the current implementation (short of re-opening a device for this) is the right way to do it?
Sorry I have no idea here.
raises:
The error is gone when
color = color
is omitted or replaced bycolor = factor(color)
. It's crucial to have a device open to reproduce this issue (can be tikz, png, pdf, jpeg, doesn't matter). On the other hand, if the current device isn't tikz, the issue cannot be reproduced.EDIT: If I return immediately from
TikZ_Raster()
, the error doesn't occur. Will investigate.