In R, it is possible to hold a device, draw the picture, and then flush the device to render the graphics. This is useful for very complex plots with thousands of data points, color gradients etc since without holding, the device would be refreshed after each plotting operation. It works quite well.
However, once the plot is in place, any window operation such as a resize will cause the plot to be refreshed -- however, this time without holding and flushing the device, but plotting the plot elements one by one and refreshing the display each time. This is extremely annoying.
Clearly, I could call manually dev.hold
before resizing the window, but this is not a real solution.
Is there a way of telling R that the device should be put on hold for operations such as resize?
dev.control("inhibit")
, though you cannot then hold/redraw/flush it. I triedp <- recordPlot()
, butreplayPlot(p)
(norgrDevices:::restoreRecordedPlot
) does not seem to respectdev.hold()
. Your answer may lie in the R source (mirrored by wch on github). – r2evans