Dr. Martin Becker, Akad. Rat
Statistics and Econometrics
Saarland University
Campus C3 1, Room 217
66123 Saarbruecken
Germany
-------------- next part --------------
diff -rupN rev59060/trunk/src/library/graphics/R/axis.R patched/trunk/src/library/graphics/R/axis.R
--- rev59060/trunk/src/library/graphics/R/axis.R 2012-04-17 10:18:28.054985800 +0200
+++ patched/trunk/src/library/graphics/R/axis.R 2012-04-17 10:22:01.636201900 +0200
@@ -54,10 +54,7 @@ Axis.table <- function(x, at, ..., side
x0 <- if (is.num) xx else seq.int(x)
if(missing(at)) at <- x0
if(missing(labels)) labels <- nx
- xaxt <- if (length(as <- list(...))) {
- if (!is.null(as$axes) && !as$axes) "n" else as$xaxt
- }## else NULL
- axis(side, at = at, labels = labels, xaxt = xaxt)
+ axis(side, at = at, labels = labels, ...)
}
else stop("only for 1-D table")
}
diff -rupN rev59060/trunk/src/library/graphics/R/plot.R patched/trunk/src/library/graphics/R/plot.R
--- rev59060/trunk/src/library/graphics/R/plot.R 2012-04-17 10:19:16.492756300 +0200
+++ patched/trunk/src/library/graphics/R/plot.R 2012-04-17 12:01:06.404223200 +0200
@@ -105,8 +105,9 @@ plot.factor <- function(x, y, legend.tex
## - if "h", make the default lwd depend on number of classes instead of lwd=2
plot.table <-
function(x, type = "h", ylim = c(0, max(x)), lwd = 2,
- xlab = NULL, ylab = NULL, frame.plot = is.num, ...)
+ xlab = NULL, ylab = NULL, frame.plot = is.num, axes = TRUE, ...)
{
+ localaxis <- function(..., col, bg, pch, cex, lty, lwd) axis(...)
xnam <- deparse(substitute(x))
rnk <- length(dim(x))
if(rnk == 0L) stop("invalid table 'x'")
@@ -121,11 +122,7 @@ plot.table <-
plot(x0, unclass(x), type = type,
ylim = ylim, xlab = xlab, ylab = ylab, frame.plot = frame.plot,
lwd = lwd, ..., xaxt = "n")
- xaxt <-
- if(length(as <- list(...))) {
- if(!is.null(as$axes) && !as$axes) "n" else as$xaxt
- }## else NULL
- axis(1, at = x0, labels = nx, xaxt = xaxt)
+ if (axes) localaxis(1, at = x0, labels = nx, ...)
} else {
if(length(as <- list(...)) && !is.null(as$main)) # use 'main'
mosaicplot(x, xlab = xlab, ylab = ylab, ...)
diff -rupN rev59060/trunk/src/library/graphics/man/plot.table.Rd patched/trunk/src/library/graphics/man/plot.table.Rd
--- rev59060/trunk/src/library/graphics/man/plot.table.Rd 2012-04-17 10:47:26.492418700 +0200
+++ patched/trunk/src/library/graphics/man/plot.table.Rd 2012-04-17 10:48:53.812413100 +0200
@@ -16,7 +16,7 @@
}
\usage{
\method{plot}{table}(x, type = "h", ylim = c(0, max(x)), lwd = 2,
- xlab = NULL, ylab = NULL, frame.plot = is.num, \dots)
+ xlab = NULL, ylab = NULL, frame.plot = is.num, axes = TRUE, \dots)
\method{points}{table}(x, y = NULL, type = "h", lwd = 2, \dots)
\method{lines}{table}(x, y = NULL, type = "h", lwd = 2, \dots)
}
@@ -30,6 +30,9 @@
\item{frame.plot}{logical indicating if a frame (\code{\link{box}})
should be drawn in the 1D case. Defaults to true when \code{x} has
\code{\link{dimnames}} coerce-able to numbers.}
+ \item{axes}{a logical value indicating whether both axes should be drawn on
+ the plot. Use \link{graphical parameter} \code{"xaxt"} or \code{"yaxt"}
+ to suppress just one of the axes.}
\item{\dots}{further graphical arguments, see \code{\link{plot.default}}.}
}
\seealso{