[Raster-commits] r464 - in pkg/raster: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jun 11 08:10:48 CEST 2009


Author: jacobvanetten
Date: 2009-06-11 08:10:46 +0200 (Thu, 11 Jun 2009)
New Revision: 464

Modified:
   pkg/raster/R/map.R
   pkg/raster/R/plot.R
   pkg/raster/man/plot.Rd
Log:
plot(axes = F) now works.

Modified: pkg/raster/R/map.R
===================================================================
--- pkg/raster/R/map.R	2009-05-25 16:35:26 UTC (rev 463)
+++ pkg/raster/R/map.R	2009-06-11 06:10:46 UTC (rev 464)
@@ -6,7 +6,7 @@
 
 
 
-.plotraster <- function(object, index=1, col = rev(terrain.colors(25)), subsample=TRUE, maxdim=500, addbox=TRUE, axes = TRUE, xlab="", ylab="", ...) {
+.plotraster <- function(object, index=1, col = rev(terrain.colors(25)), subsample=TRUE, maxdim=500, addbox=TRUE, axes, xlab, ylab, ...) {
 #TODO if xlim and/or ylim are used, only read (and sample) for those areas.
 #	require(fields)
 	if (class(object) == 'character') { 
@@ -64,7 +64,7 @@
 	
 	z[is.infinite(z)] <- NA
 	
-	.imageplot(x, y, z, col=col, axes = TRUE, xlab=xlab, ylab=ylab, ...)
+	.imageplot(x, y, z, col=col, axes = axes, xlab=xlab, ylab=ylab, ...)
 	if (addbox) {box()}
 }	
 

Modified: pkg/raster/R/plot.R
===================================================================
--- pkg/raster/R/plot.R	2009-05-25 16:35:26 UTC (rev 463)
+++ pkg/raster/R/plot.R	2009-06-11 06:10:46 UTC (rev 464)
@@ -6,8 +6,11 @@
 
 
 setMethod("plot", signature(x='RasterStack', y='ANY'), 
-	function(x, y, col=rev(terrain.colors(255)), subsample=TRUE, maxdim=500, addbox=TRUE, axes = TRUE, xlab="", ylab="", ...)  {
-		if (missing(y)) {
+	function(x, y, col=rev(terrain.colors(255)), subsample=TRUE, maxdim=500, addbox=TRUE, ...)  {
+	if(axes == NULL){axes <- TRUE}
+	if(xlab == NULL) {xlab <- ""} 
+	if(ylab == NULL) {ylab <- ""}
+	if (missing(y)) {
 			nl <- nlayers(x)
 			if (nl > 12) {
 				warning('only first 12 layers are plotted')

Modified: pkg/raster/man/plot.Rd
===================================================================
--- pkg/raster/man/plot.Rd	2009-05-25 16:35:26 UTC (rev 463)
+++ pkg/raster/man/plot.Rd	2009-06-11 06:10:46 UTC (rev 464)
@@ -27,9 +27,6 @@
 \tab \code{subsample}  \tab  Logical. If \code{TRUE}, the image is resampled using maxdim \cr
 \tab \code{maxdim}  \tab  Maximum requested number of pixels in the map display (either vertical or horizontal)  \cr
 \tab \code{addbox}  \tab  Logical. If \code{TRUE} a box is drawn around the map \cr
-\tab \code{axes}  \tab  see \code{?image} \cr
-\tab \code{xlab}  \tab  see \code{?image} \cr
-\tab \code{ylab}  \tab  see \code{?image} \cr
 \tab \code{...}  \tab  Any argument that can be passed to \code{\link[fields]{image.plot}} and to \code{\link[graphics]{plot}}  \cr
 }
 



More information about the Raster-commits mailing list