Description Usage Arguments Value Author(s) See Also Examples
Set aspect ratio match data matrix or given aspect ratio
The par("pin")
graphics parameter is adjusted to meet the requested aspect ratio
within a chosen tolerance.
1 |
dat |
A matrix to be used as a template to define aspr |
aspr |
Required aspect ratio |
tol |
Tolerance for |
pin |
Old parameters from |
G. Sawitzki
1 2 3 4 5 6 7 8 9 10 11 12 13 | parasp(aspr=sqrt(2)) # set to harmonic ratio
xx <- matrix(ncol=4,nrow=5); parasp(xx) # set to match row/col ration in xx
## The function is currently defined as
function(dat, aspr=dim(dat)[1]/dim(dat)[2], tol=0.01)
{ if (aspr<= 0) stop("parasp: aspr must be positive")
pin<-par("pin")
ar <- pin[1]/pin[2]
if (abs(ar/aspr)>tol) {
if (ar < aspr)
pin[2] <- pin[1]/aspr else pin[1] <- pin[2]* aspr
par(pin=pin)
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.