Displays the image in the current device.
plot_image(
image,
draw_grid = FALSE,
ignore_alpha = FALSE,
asp = 1,
new_page = TRUE,
return_grob = FALSE,
gp = grid::gpar(),
angle = 0,
show_linear = FALSE
)3-layer RGB/4-layer RGBA array, rayimg class, or filename of an image.
Default FALSE. If TRUE, this will draw a grid in the background to help
disambiguate the actual image from the device (helpful if the image background is the same as the
device's background).
Default FALSE. Whether to ignoe the alpha channel when plotting.
Default 1. Aspect ratio of the pixels in the plot. For example, an aspect ratio of 4/3 will
slightly widen the image.
Default TRUE. Whether to call grid::grid.newpage() before plotting the image.
Default FALSE. Whether to return the grob object.
A grid::gpar() object to include for the grid viewport displaying the image.
Default 0. Counter-clockwise rotation (in degrees) applied before plotting.
Default FALSE. Most data should be gamma corrected before displaying on a screen.
Set to TRUE to turn off this gamma correction.
#if(interactive()){
#Plot the dragon array
plot_image(dragon)
#Make pixels twice as wide as tall
plot_image(dragon, asp = 2)
#Plot non-square images
plot_image(dragon[1:100,,])
#Make pixels twice as tall as wide
plot_image(dragon[1:100,,], asp = 1/2)
#end}