Produces an interactive 3D plot of a tetrahedral colorspace using OpenGL capabilities.

Plots points in a tetrahedral color space

Produces a 3D convex hull in tetrahedral color space

tcsplot(tcsdata, size = 0.02, alpha = 1, col = "black", vertexsize = 0.02, achro = TRUE, achrosize = 0.01, achrocol = "grey", lwd = 1, lcol = "lightgrey", new = FALSE, hspin = FALSE, vspin = FALSE, floor = TRUE, grid = TRUE, fill = TRUE) tcspoints(tcsdata, size = 0.02, col = "black", alpha = 1) tcsvol(tcsdata, col = "black", alpha = 0.2, grid.alpha = 1, grid = T, fill = T, lwd = 1)

tcsdata | (required) a data frame, possibly a result from the |
---|---|

size | size of the points in the plot (defaults to 0.02) |

alpha | transparency of points (or volume fill in |

col | color of the points in the plot (defaults to black) |

vertexsize | size of the points at the vertices |

achro | plot a point at the origin? (defaults to |

achrosize | size of the point in the achromatic center |

achrocol | color of the point in the achromatic center |

lwd, lcol | graphical parameters for the edges of the tetrahedron. |

new | should a new 3D plot be called (defaults to |

hspin | if |

vspin | if |

floor | if |

grid | if |

fill | if |

grid.alpha | transparecny of the volume polygon grid lines |

`tcsplot`

creates a 3D plot using functions of the package `rgl`

,
based on openGL capabilities. Plot is interactive and can be manipulated with the mouse
(left button: rotate along 'z' axis; right button: rotate along 'x' axis;
third button: zoom). `tcsvol`

creates polygon based on points, determining the volume
occupied by them in the colorspace. `tcspoints`

adds points to the plot. Points are
currently plotted only as spheres to maintain export capabilities.
`tcspoints`

creates 3D points in a tetrahedral color space plot produced by `tcsplot`

using functions of the package `rgl`

, based on openGL capabilities.
`tcsvol`

creates a 3D convex hull within a `tcsplot`

object.

Stoddard, M. C., & Prum, R. O. (2008). Evolution of avian plumage color in a tetrahedral color space: A phylogenetic analysis of new world buntings. The American Naturalist, 171(6), 755-776.

Endler, J. A., & Mielke, P. (2005). Comparing entire colour patterns as birds see them. Biological Journal Of The Linnean Society, 86(4), 405-431.

`spheres3d`

,`rgl.postscript`

,
`rgl.snapshot`

,`rgl.material`

# NOT RUN { # For plotting data(sicalis) vis.sicalis <- vismodel(sicalis, visual = 'avg.uv') tcs.sicalis <- colspace(vis.sicalis, space = 'tcs') plot(tcs.sicalis, size = 0.005) rgl.postscript('testplot.pdf',fmt='pdf') rgl.snapshot('testplot.png') # For adding points patch <- rep(c('C', 'T', 'B'), 7) tcs.crown <- subset(tcs.sicalis, 'C') tcs.breast <- subset(tcs.sicalis, 'B') plot(tcs.crown, col ='blue') points(tcs.breast, col ='red') # For plotting convex hull plot(tcs.sicalis, col = 'blue', size = 0.005) vol(tcs.sicalis) # }