Learn R Programming

countcolors (version 0.9.1)

plotArrayAsImage: Plot a 3D array as an RGB image

Description

Plots a 3D array as an RGB image in the plot window.

Usage

plotArrayAsImage(rgb.array, main = "")

Arguments

rgb.array

3D RGB array with R, G, and B channels (pixel rows x pixel columns x color channels) to be plotted in the plot window as an actual image.

main

Optional title to display for image.

Examples

Run this code
# NOT RUN {
# Read in image
flowers <- jpeg::readJPEG(system.file("extdata", "flowers.jpg", package =
"countcolors"))

# Plot
plotArrayAsImage(flowers, main = "flowers!")

# }

Run the code above in your browser using DataLab