function to do ...

Description

Sets graphic parameters for a matrix layout. Image shows matrix in transposed flipped form.

Usage

1
parmfrow(dims, aspr = dims[1]/dims[2], minin = 0.25)

Arguments

dims

dims is in (y,x) order as returned by dim().

aspr

aspect ration in dy/dx form.

minin

smallest size.

Value

returned from par().

Author(s)

G. Sawitzki

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (dims, aspr=dims[1]/dims[2], minin=0.25)
# all internal aspect ratios ar in dy/dx form.
# note: dims is in (y,x) order as returned by dim
# dim is in row,col
# din is in x,y
# image shows matrix in transposed flipped form
{
 	if (aspr<= 0) stop("parmfrow: aspr must be positive")
	if (minin<= 0.1) stop("parmfrow: mini must be at least 0.1 inch")
	din<-par("din")
	dar <- din[2]/din[1]
	if (aspr>1) {
		#print("matrix high") 
		minx <- minin; miny <- minin/aspr} else
		{
		#print("matrix wide")
		minx <- minin*aspr; miny <-   minin
		}
	#cat(din,dar,"\n")
	#if (dar>1) print("device high") else print("device wide")

	nx <- floor(din[1] / minx)
	ny <- floor(din[2] / miny)
	#cat(nx,ny,"\n")
	if (interactive()) 
		par(mfrow=c(ny,nx), ask=TRUE) else par(mfrow=c(ny,nx))
  }