plot_tile: Plotting Objects

Description Usage Arguments Details Value Examples

View source: R/plot_methods.R

Description

Plotting method for objects of class Tile, SpectralPack, SAM, Smooth, and clipper.

In objects of class SAM, always the clusters slot gets plotted.

Usage

1
2
3
4
## S4 method for signature 'plot.uFTIR,missing'
plot(x, y, ...)

plot_tile(x, slice = 1, FUN = sum, match_uFTIR = FALSE, ...)

Arguments

x

Tile, SpectralPack, SAM, Smooth, or clipper to plot.

y

Missing.

...

Further arguments to plot

slice

For objects of class SAM or Smooth, Which slice of the cube should be plotted?

FUN

For objects of class SpectralPack and Tile, Which function should be used to collapse the cube to a matrix?

match_uFTIR

The Agilent Microscope transposes and inverts the image (it inverts rows only -cols after transposition). Do you want the plot function to match this behaviour? Default FALSE.

Details

The function requires the raster package to plot. It coerses the matrix to raster to do so.

Value

A function that plots a tile and returns NULL.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Tile objects:
x <- tile_read(base::system.file("extdata/tile.bsp", package = "uFTIR"))
plot(x)
# with arguments for raster::plot
plot(x, axes = FALSE, box = FALSE, legend = FALSE)

# SpectralPack objects:
x <- tile_base_corr(x)
x <- wavealign(x, primpke)
plot(x) 

# SAM objects:
x <- tile_sam(x)
plot(x)

# Smooth objects
x <- smooth_sam(x, as.integer(length(primpke@clusternames)), window = 3, 1)
plot(x)

# clipper objects:
clip <- toClip(8,20,c(10,10))
polygon(clip@xycoords)
x <- clipper(x, clip@centre, clip@rad, 1)
plot(x)

uFTIR documentation built on Oct. 25, 2021, 9:08 a.m.