imHeatmap {recolorize} | R Documentation |
Plot a heatmap of a matrix of color distances
Description
Plots the output of imDist
as a heatmap.
Usage
imHeatmap(
mat,
palette = "default",
main = "",
range = NULL,
legend = TRUE,
...
)
Arguments
mat |
A color distance matrix, preferably output of
|
palette |
The color palette to be used. Default is blue to
red ( |
main |
Plot title. |
range |
Range for heatmap values. Defaults to the range of values in the matrix, but should be set to the same range for all images if comparing heatmaps. |
legend |
Logical. Add a continuous color legend? |
... |
Parameters passed to |
Value
Nothing; plots a heatmap of the color residuals.
Examples
chongi <- system.file("extdata/chongi.png", package = "recolorize")
chongi <- png::readPNG(chongi)
chongi_k <- recolorize(chongi, "k", n = 5)
recolored_chongi <- constructImage(chongi_k$pixel_assignments,
chongi_k$centers)
d <- imDist(chongi,
recolored_chongi, plotting = FALSE)
# original flavor
imHeatmap(d)
# bit offputting
imHeatmap(d, palette = colorRamps::ygobb(100))
# just dreadful
imHeatmap(d, palette = colorRamps::primary.colors(100))
[Package recolorize version 0.1.0 Index]