View source: R/plotImageArray.R
plotImageArray | R Documentation |
Does what it says on the tin. An extremely simple wrapper for
graphics::rasterImage()
, but maintains aspect ratio, removes
axes, and reduces margins for cleaner plotting.
plotImageArray(rgb_array, main = "", ...)
rgb_array |
A 3D array of RGB values. Preferably output from
|
main |
Optional title for plot. |
... |
Parameters passed to graphics::plot. |
No return value; plots image.
# make a 100x100 image of random colors
random_colors <- array(runif(100 * 100 * 3),
dim = c(100, 100, 3))
recolorize::plotImageArray(random_colors)
# we can also plot...a real image
corbetti <- system.file("extdata/corbetti.png",
package = "recolorize")
img <- png::readPNG(corbetti)
plotImageArray(img)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.