From jeroen at berkeley.edu  Mon May 15 14:07:28 2017
From: jeroen at berkeley.edu (Jeroen Ooms)
Date: Mon, 15 May 2017 14:07:28 +0200
Subject: [Rd] Error messages in replayPlot()
Message-ID: <CABFfbXtAaM0O0dtFFdLYBk40w1ADaoUz4UJVMRBOVmfgma6YPA@mail.gmail.com>

I was wondering if there is something that can be done to improve
error messages when replaying a recorded plot. For example a graphics
device that is too small usually results in a helpful error message:

 png(height = 100)
 plot(1)
 # Error in plot.new() : figure margins too large
 dev.off()

However when this happens when replaying a recorded plot, the error
message is not so helpful.

 myplot <- evaluate::evaluate("plot(1)")[[2]]
 png(height = 100)
 replayPlot(myplot)
 # Error in replayPlot(x) : invalid graphics state
 dev.off()

A more informative error message that hints at what exactly is invalid
about the graphics state would be very helpful in this case.



[Rd] Error messages in replayPlot()
Jeroen Ooms