Re: [Rd] '...' passed to both plot() and legend()

2006-03-02 Thread Gabor Grothendieck
You can remove the legend names, assuming there are none that are also plot names, like this (untested): args <- list(...) legnams <- intersect(names(args), names(formals(legend))] do.call("plot", replace(args, legnams, NULL)) On 3/2/06, Dimitris Rizopoulos <[EMAIL PROTECTED]> wrote: > Dear R-de

Re: [Rd] '...' passed to both plot() and legend()

2006-03-02 Thread Prof Brian Ripley
See e.g. graphics:::plot.POSIXct, which contains axisInt <- function(x, type, main, sub, xlab, ylab, col, lty, lwd, xlim, ylim, bg, pch, log, asp, axes, frame.plot, ...) axis.POSIXct(1, x, ...) You could use such as wrapper for legend, in your case probably to pick out jus

[Rd] '...' passed to both plot() and legend()

2006-03-02 Thread Dimitris Rizopoulos
Dear R-devels, I'd like to create a plot method for a class of objects that passes the '...' argument to both plot() and legend(), e.g., x <- list(data = rnorm(1000)) class(x) <- "foo" plot.foo <- function(x, legend = FALSE, cx = "topright", cy = NULL, ...){ dx <- sort(x$data) plot(dx,