plotClusters {colordistance}R Documentation

Plot clusters in 3D color space

Description

Interactive, 3D plot_ly plots of cluster sizes and colors for each image in a list of cluster dataframes in order to visualize cluster output.

Usage

plotClusters(
  cluster.list,
  color.space = "rgb",
  p = "all",
  pausing = TRUE,
  ref.white,
  to = "sRGB"
)

Arguments

cluster.list

A list of identically sized dataframes with 4 columns each (R, G, B, Pct or H, S, V, Pct) as output by extractClusters or getHistList.

color.space

The color space ("rgb", "hsv", or "lab") in which to plot pixels.

p

Numeric vector of indices for which elements to plot; otherwise each set of clusters is plotted in succession.

pausing

Logical. Should the function pause and wait for user keystroke before plotting the next plot?

ref.white

The reference white passed to convertColorSpace; must be specified if using color.space = "lab".

to

Display color space of image if clustering in CIE Lab space, probably either "sRGB" or "Apple RGB", depending on your computer.

Value

A 3D plot_ly plot of cluster sizes in the specified colorspace for each cluster dataframe provided.

Examples

## Not run: 
# Takes >10 seconds
cluster.list <- colordistance::getHistList(dir(system.file("extdata",
"Heliconius/", package="colordistance"), full.names=TRUE), plotting=FALSE,
lower=rep(0.8, 3), upper=rep(1, 3))

colordistance::plotClusters(cluster.list, p=c(1:3, 7:8), pausing=FALSE)

clusterListHSV <- colordistance::getHistList(dir(system.file("extdata",
"Heliconius/", package="colordistance"), full.names=TRUE), hsv=TRUE,
plotting=FALSE, lower=rep(0.8, 3), upper=rep(1, 3))

colordistance::plotClusters(clusterListHSV, p=c(1:3, 7:8), hsv=TRUE,
pausing=FALSE)

## End(Not run)

[Package colordistance version 1.1.2 Index]