layout.center | R Documentation |
The layout.center
function takes a matrix of coordinates and an x- and y-coordinate range and centers the input coordinates within the range.
The layout.normalize
function takes a matrix of coordinates and rescales them to the range (-1,1). If keep.aspect.ratio=FALSE
, x- and y-coords are rescaled independently.
layout.center(coords, xlim, ylim)
layout.normalize(coords, keep.aspect.ratio = TRUE)
coords |
two column numeric matrix of coordinates. |
xlim |
two element numeric vector giving min and max of x axis |
ylim |
two element numeric vector giving min and max of y axis |
keep.aspect.ratio |
boolean, if FALSE, x- and y-axis will be rescaled indpendently |
These functions are used internally, but can also be called by the user when manipulating coordinates for layouts, especially when the coordinate ranges for a sequence of layouts do not match up well. TODO: add barycenter function, and center on vertex function
The input two column numeric matrix of coordinates with positions transformed.
skyebend
data(McFarland_cls33_10_16_96)
coords<-plot(cls33_10_16_96)
# center layout coords with 100 unit area
layout.center(coords,xlim=c(0,100),ylim=c(0,100))
# rescale layout coords to unit interval
layout.normalize(coords)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.