|
|
@@ -67,4 +67,69 @@ label.default <- function(objet) |
|
|
|
} |
|
|
|
} |
|
|
|
objet |
|
|
|
} |
|
|
|
|
|
|
|
#' Fonction de remplacement pour plot |
|
|
|
#' |
|
|
|
#' plot en utilisant les labels comme étiquettes |
|
|
|
#' |
|
|
|
#' @encoding ISO-8859-1 |
|
|
|
#' @export |
|
|
|
plot.default<-function (x, y = NULL, type = "p", xlim = NULL, ylim = NULL, |
|
|
|
log = "", main = NULL, sub = NULL, xlab = NULL, ylab = NULL, |
|
|
|
ann = par("ann"), axes = TRUE, frame.plot = axes, panel.first = NULL, |
|
|
|
panel.last = NULL, asp = NA, ...) |
|
|
|
{ |
|
|
|
localAxis <- function(..., col, bg, pch, cex, lty, lwd) Axis(...) |
|
|
|
localBox <- function(..., col, bg, pch, cex, lty, lwd) box(...) |
|
|
|
localWindow <- function(..., col, bg, pch, cex, lty, lwd) plot.window(...) |
|
|
|
localTitle <- function(..., col, bg, pch, cex, lty, lwd) title(...) |
|
|
|
xlabel <- if (!missing(x)) |
|
|
|
{ |
|
|
|
if (is.null(label(x))) |
|
|
|
deparse(substitute(x)) |
|
|
|
else |
|
|
|
label(x) |
|
|
|
} |
|
|
|
ylabel <- if (!missing(y)) |
|
|
|
{ |
|
|
|
if (is.null(label(y))) |
|
|
|
deparse(substitute(y)) |
|
|
|
else |
|
|
|
label(y) |
|
|
|
} |
|
|
|
xy <- xy.coords(x, y, xlabel, ylabel, log) |
|
|
|
xlab <- if (is.null(xlab)) |
|
|
|
xy$xlab |
|
|
|
else xlab |
|
|
|
ylab <- if (is.null(ylab)) |
|
|
|
xy$ylab |
|
|
|
else ylab |
|
|
|
xlim <- if (is.null(xlim)) |
|
|
|
range(xy$x[is.finite(xy$x)]) |
|
|
|
else xlim |
|
|
|
ylim <- if (is.null(ylim)) |
|
|
|
range(xy$y[is.finite(xy$y)]) |
|
|
|
else ylim |
|
|
|
dev.hold() |
|
|
|
on.exit(dev.flush()) |
|
|
|
plot.new() |
|
|
|
localWindow(xlim, ylim, log, asp, ...) |
|
|
|
panel.first |
|
|
|
plot.xy(xy, type, ...) |
|
|
|
panel.last |
|
|
|
if (axes) { |
|
|
|
localAxis(if (is.null(y)) |
|
|
|
xy$x |
|
|
|
else x, side = 1, ...) |
|
|
|
localAxis(if (is.null(y)) |
|
|
|
x |
|
|
|
else y, side = 2, ...) |
|
|
|
} |
|
|
|
if (frame.plot) |
|
|
|
localBox(...) |
|
|
|
if (ann) |
|
|
|
localTitle(main = main, sub = sub, xlab = xlab, ylab = ylab, |
|
|
|
...) |
|
|
|
invisible() |
|
|
|
} |