plot_crosslines: Plot cross lines

View source: R/plot_cross.R

plot_crosslinesR Documentation

Plot cross lines

Description

Add lines for a cross

Usage

plot_crosslines(
  momloc,
  dadloc,
  kidsloc,
  gap = 3,
  chrlength = 30,
  cex = 1.5,
  lwd = 2,
  arrow_length = 0.1,
  col = "white",
  ...
)

Arguments

momloc

An (x,y) vector with center location for mother

dadloc

An (x,y) vector with center location for mother

kidsloc

Either an (x,y) vector with center location for a kid, or a list of such for multiple kids

gap

Gap arrows and points/rectangles

chrlength

Length of chromosomes

cex

Character expansion for x point

lwd

Line width for points, segments, and arrows

arrow_length

The length parameter in the call to graphics::arrows()

col

Color of lines and points

...

Additional arguments passed to arrows() and segments()

Value

None.

See Also

plot_ind()

Examples


mom <- create_parent(100, 1:2)
dad <- create_parent(100, 3:4)
kids <- lapply(1:4, function(junk) cross(mom, dad))
plot(0,0, type="n", xlim=c(0, 100), ylim=c(0,100),
     xaxt="n", yaxt="n", xlab="", ylab="")
loc <- list(c(25,75), c(75,75), c(12.5,25), c(37.5,25), c(62.5, 25), c(87.5,25))
plot_ind(mom, loc[[1]])
plot_ind(dad, loc[[2]])
for(i in 1:4) plot_ind(kids[[i]], loc[[i+2]])
plot_crosslines(loc[[1]], loc[[2]], loc[3:6])

kbroman/simcross documentation built on Jan. 13, 2024, 10:31 p.m.