# plotRGB

0th

Percentile

##### Red-Green-Blue plot of a multi-layered Raster object

Make a Red-Green-Blue plot based on three layers (in a RasterBrick or RasterStack). Three layers (sometimes referred to as "bands" because they may represent different bandwidths in the electromagnetic spectrum) are combined such that they represent the red, green and blue channel. This function can be used to make 'true (or false) color images' from Landsat and other multi-band satellite images.

Keywords
methods, spatial
##### Usage
# S4 method for RasterStackBrick
plotRGB(x, r=1, g=2, b=3, scale, maxpixels=500000, stretch=NULL,
ext=NULL, interpolate=FALSE, colNA='white', alpha, bgalpha, addfun=NULL, zlim=NULL,
zlimcol=NULL, axes=FALSE, xlab='', ylab='', asp=NULL, add=FALSE, margins=FALSE, ...)
##### Arguments
x

RasterBrick or RasterStack

r

integer. Index of the Red channel, between 1 and nlayers(x)

g

integer. Index of the Green channel, between 1 and nlayers(x)

b

integer. Index of the Blue channel, between 1 and nlayers(x)

scale

integer. Maximum (possible) value in the three channels. Defaults to 255 or to the maximum value of x if that is known and larger than 255

maxpixels

integer > 0. Maximum number of pixels to use

stretch

character. Option to stretch the values to increase the contrast of the image: "lin" or "hist"

ext

An Extent object to zoom in to a region of interest (see drawExtent)

interpolate

logical. If TRUE, interpolate the image when drawing

colNA

color for the background (NA values)

alpha

transparency. Integer between 0 (transparent) and 255 (opaque)

bgalpha

Background transparency. Integer between 0 (transparent) and 255 (opaque)

Function to add additional items such as points or polygons to the plot (map). See plot

zlim

numeric vector of length 2. Range of values to plot (optional)

zlimcol

If NULL the values outside the range of zlim get the color of the extremes of the range. If zlimcol has any other value, the values outside the zlim range get the color of NA values (see colNA)

axes

logical. If TRUE axes are drawn (and arguments such as main="title" will be honored)

xlab

character. Label of x-axis

ylab

character. Label of y-axis

asp

numeric. Aspect (ratio of x and y. If NULL, and appropriate value is computed to match data for the longitude/latitude coordinate reference system, and 1 for planar coordinate reference systems

logical. If TRUE add values to current plot

margins

logical. If TRUE standard whitespace margins are used. If FALSE, graphics::par(plt=c(0,1,0,1)) is used

...

graphical parameters as in plot or rasterImage

plot

##### Aliases
• plotRGB
• plotRGB,RasterStackBrick-method
##### Examples
# NOT RUN {
b <- brick(system.file("external/rlogo.grd", package="raster"))
plotRGB(b)
plotRGB(b, 3, 2, 1)
plotRGB(b, 3, 2, 1, stretch='hist')
# }

Documentation reproduced from package raster, version 3.0-2, License: GPL (>= 3)

### Community examples

Looks like there are no examples yet.
{"ft_lang_label":"__label__en","ft_lang_prob":0.7005142,"math_prob":0.93035436,"size":2723,"snap":"2019-35-2019-39","text_gpt3_token_len":749,"char_repetition_ratio":0.09709452,"word_repetition_ratio":0.032941177,"special_character_ratio":0.24899009,"punctuation_ratio":0.14531548,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9851116,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-09-21T09:35:00Z\",\"WARC-Record-ID\":\"<urn:uuid:c9d75a80-55fc-4912-a577-bcbd0afca53a>\",\"Content-Length\":\"18182\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e790c33d-04eb-4868-b75b-951755009508>\",\"WARC-Concurrent-To\":\"<urn:uuid:a1c769fe-abf2-4903-994f-a54f416286ac>\",\"WARC-IP-Address\":\"35.174.49.12\",\"WARC-Target-URI\":\"https://www.rdocumentation.org/packages/raster/versions/3.0-2/topics/plotRGB\",\"WARC-Payload-Digest\":\"sha1:TOQES7DCD4FEDKWVRQL567DTPJBC6NWV\",\"WARC-Block-Digest\":\"sha1:MNQTPCNRMZC5VNZARMVBASXDGFS2HHK4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-39/CC-MAIN-2019-39_segments_1568514574377.11_warc_CC-MAIN-20190921084226-20190921110226-00368.warc.gz\"}"}