首页 > 解决方案 > rstudio plotRGB 警告消息:1:在 .local(x, ...) 中:图层已更改为 1

问题描述

我正在尝试在 R 中绘制 Sentinel2 图像。我想使用 plotRGB 来获得真彩色图像。我的脚本如下所示:

library(raster)
library(sp)
library(rgdal)
library(ggplot2)


r=raster("Part1.tif")
brick_r=brick(r)

plotRGB(brick_r, r=1, g=2, b=3, stretch="lin")

//The problem is that the plot always comes out black and white. Together with that warning messages:

Warning messages:
1: In .local(x, ...) : layer was changed to 1
2: In .local(x, ...) : layer was changed to 1
3: In .local(x, ...) : layer was changed to 1 

Wo知道如何解决这个问题吗?我在网上找不到解决方案。

标签: plotrstudiorgbr-rastersentinel2

解决方案


推荐阅读