Learn R Programming

pavo (version 2.9.0)

jndplot: Perceptually-corrected chromaticity diagrams

Description

Plot options for jnd2xyz objects.

Usage

jndplot(
  x,
  arrow = c("relative", "absolute", "none"),
  achro = FALSE,
  arrow.labels = TRUE,
  arrow.col = "darkgrey",
  arrow.p = 1,
  labels.cex = 1,
  margin = "recommended",
  square = TRUE,
  ...
)

Value

Creates a plot, details of the plot depend on the input data.

Arguments

x

(required) the output from a jnd2xyz() call.

arrow

If and how arrows indicating receptor vectors should be drawn. Options are "relative" (default), "absolute" or "none". See description.

achro

Logical. Should the achromatic variable be plotted as a dimension? (only available for dichromats and trichromats, defaults to FALSE).

arrow.labels

Logical. Should labels be plotted for receptor arrows? (defaults to TRUE)

arrow.col

color of the arrows and labels.

arrow.p

scaling factor for arrows.

labels.cex

size of the arrow labels.

margin

accepts either "recommended", where the function will choose margin attributes, or a numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margin to be specified on the four sides of the plot. (Default varies depending on plot dimensionality).

square

logical. Should the aspect ratio of the plot be held to 1:1? (defaults to TRUE).

...

additional parameters to be passed to plot(), arrows() and graphics::persp() (for 3D plots).

Author

Rafael Maia rm72@zips.uakron.edu

References

Pike, T.W. (2012). Preserving perceptual distances in chromaticity diagrams. Behavioral Ecology, 23, 723-728.

Examples

Run this code
# Load floral reflectance spectra
data(flowers)

# Estimate quantum catches visual phenotype of a Blue Tit
vis.flowers <- vismodel(flowers, visual = 'bluetit')

# Estimate noise-weighted colour distances between all flowers
cd.flowers <- coldist(vis.flowers)

# Convert points to Cartesian coordinates in which Euclidean distances are
# noise-weighted.
propxyz <- jnd2xyz(cd.flowers)

# Plot the floral spectra in 'noise-corrected' space
plot(propxyz)

Run the code above in your browser using DataLab