R/image.bertin.R

#$HeadURL: file:///srv/svn/bertin/pkg/bertin/R/image.bertin.R $
#$Id: image.bertin.R 51 2011-10-10 20:00:25Z gsawitzki $
#$Revision: 51 $
#$Date: 2011-10-10 22:00:25 +0200 (Mon, 10 Oct 2011) $
#$Author: gsawitzki $

##ffrom image:
##(x = seq(0, 1, len = nrow(z)), y = seq(0, 1, len = ncol(z)), 
##    z, zlim = range(z[is.finite(z)]), xlim = range(x[is.finite(x)]), 
##    ylim = range(y[is.finite(y)]), col = heat.colors(12), add = FALSE, 
##    xaxs = "i", yaxs = "i", xlab, ylab, breaks, oldstyle = FALSE, useRaster = FALSE,
##    ...) 
##

image.bertin <- function
(z, roworder,colorder,
	main, 
	sub,
	mar= c(3,1,3,1)+0.1,
	palette = gray((255:0 / 255)^0.5),
	showpalette=TRUE,
	useRaster = FALSE,
	...)
{#$Revision: 51 $
	if (missing(roworder)) {
	roworder <- attr(z,"roworder")
	if (is.null(roworder) ) roworder <- 1:nrow(z)
	}

	if (missing(colorder)) {
	colorder <- attr(z,"colorder")
	if (is.null(colorder) ) colorder <- 1:ncol(z)	
	}

	if (missing(main)) {
	main <- attr(z,"main")
	if (is.null(main) ) main <- deparse(substitute(z))	
	}

	if (missing(sub)) {
	sub <- attr(z,"sub")
	}

	imagem(z[roworder,colorder], 
		main=main, 
		palette = palette, 
		mar=mar, useRaster=useRaster, ...)

	if (!is.null(sub)) {title(sub=sub, line=1, cex.sub=0.8)}
	if (showpalette) {bertin:::colrampmarg(palette, main="Score Colour Codes (by %)")}

	attr(z,"roworder")<-roworder
	attr(z,"colorder")<-colorder
	attr(z,"main")<-main
	invisible(z)
}

Try the bertin package in your browser

Any scripts or data that you put into this service are public.

bertin documentation built on May 2, 2019, 5:54 p.m.