我想使用绘图功能获得单色图像。但它继续产生彩色图像。我什至有使用绘图功能绘制的单色图像,并且我得到了一些奇怪的绿色和橙色。如何使绘图功能提供单色图像?我试图阅读有关 getValues 函数的信息,但发现它很难理解,因为我不是来自图像分析背景。似乎 getBlocks() 函数返回单色图像。但是有没有办法只使用绘图功能来获得单色图像?
library(raster)
r <- raster(matrix(runif(100), 10))
plot(r)
#even below lines produce a yellow color image. i thought that they will produce a black or white square
r <- raster(matrix(rep(0,100), 10))
plot(r)