mplot_raster: Plot Array as Raster Image

View source: R/mplot_raster.R

mplot_rasterR Documentation

Plot Array as Raster Image

Description

Plots 2D (grayscale) or 3D (color) array as Raster Image

Usage

mplot_raster(
  x,
  max.value = max(x),
  mar = NULL,
  main = NULL,
  main.line = 0,
  main.side = 3,
  main.col = "#ffffff",
  main.adj = 0,
  main.font = 2,
  mono = FALSE,
  mono.fn = mean,
  bg = "gray10",
  par.set = TRUE,
  par.reset = TRUE,
  verbose = TRUE
)

Arguments

x

Array, 2D or 3D: Input describing grayscale or color image in RGB space

mono

Logical: If TRUE, plot as grayscale using mono.fn to convert RGB to grayscale. Default = FALSE

mono.fn

Function: Apply this function to the array to convert to 2D for grayscale plotting. Default = mean

bg

Color: Background color (around the plotted image when window proportions do not match image). Default = "gray10"

par.reset

Logical: If TRUE, reset par settings before exiting. Default = TRUE

verbose

Logical: If TRUE, print messages to console. Default = TRUE

Author(s)

E.D. Gennatas

Examples

## Not run: 
img <- imager::load.image("https://www.r-project.org/logo/Rlogo.png")
mplot_raster(img)

## End(Not run)

egenn/rtemis documentation built on Oct. 28, 2024, 6:30 a.m.