Learn R Programming

rtiff (version 1.4.8)

plot.matrix: Overload the plot function for matrices

Description

This is a simple S3 method for the plot function which takes a matrix, converts it to an RGB pixmap (by replicating it 3 times, once for each channel), and then plotting the resulting image.

Usage

# S3 method for matrix
plot(x, ...)

Arguments

x

A matrix representing an image raster.

...

Additional arguments to send to plot.

Value

None.

Examples

Run this code
# NOT RUN {
tif <- readTiff(system.file("tiff", "jello.tif", package="rtiff"))
plot(tif@red) 
# }

Run the code above in your browser using DataLab