plot2D.zoom: Zooms into a section of an array object and plots it

View source: R/plot2D.zoom.R

plot2D.zoomR Documentation

Zooms into a section of an array object and plots it

Description

Takes in an array object, T_{m,n,p}.
Also requires centre of the zoom area, given by center and the expected zoom dimensions Del_X and Del_Y.
Then, it returns the subsetted array in accordance to the zoom requirements set by center, Del_X and Del_Y

Usage

plot2D.zoom(arr, center, Del_X, Del_Y, pl = T)
plot2D.zoom(arr, center, Del_X, Del_Y)
plot2D.zoom(arr, center, Del_X, Del_Y, pl = F)

Arguments

arr

The array object, T_{m,n,p}.
Has to be a rank-3 array.
p \in \{1, 2, 3\}, since T_{m,n,p} has to be 3-slice.
For better understanding of structure of array, check img_2_arr.

center

Two element vector denoting the (X, Y) values of the center of the zoom-area

Del_X

The length of the zoomed image along the X-axis

Del_Y

The length of the zoomed image along the Y-axis

pl

Plots the new array if pl == T.
Set to TRUE by default

Details

See the image below.
zoom_array.png

Value

The returned value is necessarily an array of the same structure as arr

Author(s)

Chitran Ghosal

See Also

img_2_arr

Examples

library(StatsChitran)
dat <- system.file("extdata", "STM.png", package = "StatsChitran")
arr1 <- img_2_arr(source.png = dat, x.lim = c(0, 19), y.lim = c(0,19)) #The image array
arr.zoom <- plot2D.zoom(arr = arr1, center = c(16, 12), Del_X = 6, Del_Y = 6) #The zoomed in array

Chitran1987/StatsChitran documentation built on June 8, 2025, 2:24 a.m.