plot_ind: Plot an individual

View source: R/plot_cross.R

plot_indR Documentation

Plot an individual

Description

Add an individual, as a pair of chromosomes, to a plot

Usage

plot_ind(
  ind,
  center,
  chrlength = 30,
  chrwidth = 3,
  gap = 3,
  col = CCcolors(),
  border = "black",
  lend = 1,
  ljoin = 1,
  allborders = FALSE,
  ...
)

Arguments

ind

An individual object, as output by create_parent() or cross()

center

(x,y) vector for the center of the individual

chrlength

Length of chromosomes (Can be a vector of length 2, in which case the two chromosomes will be different lengths, aligned at the top. This is for the X chromosome.)

chrwidth

Width of chromosomes

gap

Gap between chromosomes

col

Vector of colors

border

Color for border

lend

Passed to graphics::rect()

ljoin

Passed to graphics::rect()

allborders

If TRUE, put borders around all segments

...

Additional arguments passed to rect()

Value

None.

See Also

plot_crosslines()

Examples


mom <- create_parent(100, 1:2)
dad <- create_parent(100, 3:4)
kid <- 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(50,25))
plot_ind(mom, loc[[1]])
plot_ind(dad, loc[[2]])
plot_ind(kid, loc[[3]])
plot_crosslines(loc[[1]], loc[[2]], loc[[3]])

simcross documentation built on May 29, 2024, 2:41 a.m.