-
Notifications
You must be signed in to change notification settings - Fork 504
Open
Description
When plotting a binary raster with addRasterImage()
, even when the parameter "colors" is set to two colors, the plotted raster shows more than two colors. It seems that it's interpolating color values, even though this is not desired with a binary raster. Zoom in on the example below to see. If there's a way to fix this, please let me know.
v <- sample(c(0,1), 40000, replace = TRUE)
x <- raster::raster(nrows=160,ncols=250,xmn=-120,xmx=-80,ymn=15,ymx=40,vals=v)
m <- leaflet() %>% setView(-100, 25, zoom = 3) %>% addProviderTiles('Esri.WorldTopoMap')
m %>% addRasterImage(x, colors = c('red','blue'))
Metadata
Metadata
Assignees
Labels
No labels