rspatial/terra

Feature request: pletRGB()

Closed this issue · 4 comments

The equivalent of plotRGB() in leaflet ("pletRGB") would be very useful.

You can do something like

RGB(x) <- 1:3
plet(x)

Is that good enough?

You can now also do

RGB(x) <- 1:3
plet(x, stretch="lin")

With the last version I get from github:

> library(RStoolbox) #for the lsat image
This is version 1.0.0 of RStoolbox
> library(terra)
terra 1.8.3
> library(leaflet)

r <- terra::subset(lsat,c(7,5,4))
plotRGB(r,stretch="lin")

image

RGB(r) <- 1:3
r[r==0] <- NA
plet(r, stretch="lin")

image

The display of plotRGB() is still a bit better, but this is a very significant improvement!

It looks more like plotRGB with alpha=1

plet(r, stretch="lin", alpha=1)