Learn R Programming

barsurf (version 0.7.0)

61_check_xy_relationship: Test Axis Relationship

Description

Estimate the (plotting) relationship between the x and y axes.

Usage

test.xyrel (x, y, fv)

Arguments

x, y

Optional numeric vectors.

fv

A numeric matrix.

Value

Refer to details.

Details

This function is designed to work with the xyrel argument in the main plotting functions.

It returns "f" (for a fixed aspect ratio of one) or "m" (for maximized).

If the ratio between the x-size and the y-size is between 0.1 and 10, it will return "f". Otherwise, it returns "m".

If both x any y are missing, the "size" refers to the dimensions of the matrix. (So, returns "f" for up to ten times more columns than rows, or vice versa).

If both x and y are supplied, the "size" refers to xlim and ylim, computed from the ranges of x and y.

If one is supplied but the other is not, then "m" is returned.

Examples

Run this code
# NOT RUN {
fv1 <- matrix (1:40, 2, 20)
fv2 <- matrix (1:50, 2, 25)

test.xyrel (,,fv1)
test.xyrel (seq (0, 1,, 2), seq (0, 20,, 20), fv1)

test.xyrel (,,fv2)
test.xyrel (seq (0, 1,, 2), seq (0, 1,, 25), fv1)
# }

Run the code above in your browser using DataLab