scatter3dclusters: Plot 3D clusters in a 2D plot

Description Usage Arguments See Also Examples

View source: R/05_output_visualization.R

Description

Uses scatterplot3d to plot clusters in color space.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
scatter3dclusters(
  clusters,
  color.space,
  ref.white = "D65",
  xlim = "default",
  ylim = "default",
  zlim = "default",
  main = "Color clusters",
  scaling = 10,
  opacity = 0.9,
  plus = 0.01,
  ...
)

Arguments

clusters

A single dataframe or a list of dataframes as returned by getLabHist, getLabHistList, or extractClusters. First three columns must be color coordinates and fourth column must be cluster size.

color.space

The color space ("rgb", "hsv", or "lab") in which to plot. If not specified, the function uses column names to guess the color space.

ref.white

Standard reference white for converting lab coordinates to RGB coordinates for coloring clusters. One of either "A", "B", "C", "E", "D50", "D55", or "D65".

xlim, ylim, zlim

X, Y, and Z-axis limits. If not specified, the defaults are 0-1 for all channels in RGB and HSV space, or 0-100 for L and -100-100 for a and b channels of CIE Lab space.

main

Title for the plot.

scaling

Scaling factor for size of clusters.

opacity

Transparency value for plotting; must be between 0 and 1.

plus

Amount to add to percent column for plotting; can help to make very small (or 0) clusters visible.

...

Additional parameters passed to scatterplot3d.

See Also

plotClusters, plotClustersMulti

Examples

1
2
3
4
5
6
7
8
9
clusters <- data.frame(R = runif(20, min = 0, max = 1),
                       G = runif(20, min = 0, max = 1),
                       B = runif(20, min = 0, max = 1),
                       Pct = runif(20, min = 0, max = 1))
# plot in RGB space
scatter3dclusters(clusters, scaling = 15, plus = 0.05)

# overrule determined color space and plot in HSV space
scatter3dclusters(clusters, scaling = 15, plus = 0.05, color.space = "hsv")

Example output



colordistance documentation built on March 21, 2021, 1:06 a.m.