plotHist {colordistance}R Documentation

Color histogram of binned image

Description

Plots a color histogram from a dataframe as returned by getImageHist, getHistList, or extractClusters. Bars are colored according to the color of the bin.

Usage

plotHist(
  histogram,
  pausing = TRUE,
  color.space = "rgb",
  ref.white,
  from = "sRGB",
  main = "default",
  ...
)

Arguments

histogram

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.

pausing

Logical. Pause and wait for keystroke before plotting the next histogram?

color.space

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

ref.white

The reference white passed to convertColorSpace; must be specified if using CIE Lab space. See convertColorSpace.

from

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

main

Title for plot. If "default", the name of the cluster histogram is used.

...

Optional arguments passed to the barplot function.

Examples

color_df <- as.data.frame(matrix(rep(seq(0, 1, length.out=3), 3), nrow=3,
ncol=3))

color_df$Pct <- c(0.2, 0.5, 0.3)

colordistance::plotHist(color_df, main="Example plot")

[Package colordistance version 1.1.2 Index]