[Rd] feature request: additional hook in plot.new()
thomas.friedrichsmeier at ruhr-uni-bochum.de
Sun Jan 23 20:06:09 CET 2011
On Sunday 23 January 2011, you wrote:
> Request: An additional hook in plot.new() that is called prior to the call
> to .Internal(plot.new()). Reason: To allow the hook to set up or modify a
> graphics device that the new plot will appear in.
for what it's worth, you can work around the lack of this hook by modifying
plot.new(). Here's what we do in RKWard (in order to add a plot history
"plot.new" <- function ()
# [your code goes here]
eval (body (.rk.plot.new.default))
formals (plot.new) <- formals (graphics::plot.new)
.rk.plot.new.default <- graphics::plot.new
# Note: This needs to be called *after* the package has been loaded
assignInNamespace ("plot.new", plot.new, envir=as.environment
Note that at least persp() also sets up a new plot, _without_ calling
plot.new(). So you'll want to catch that as well.
In RKWard we use this technique at a number of places to insert "hooks" where
there are none, regularly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: This is a digitally signed message part.
More information about the R-devel