1

When I try plotting a Raster object, R gives a plot without colors.

library(raster)
r.base <- raster(ncol=40,nrow=40,xmn=-74,xmx=-34,ymn=-34,ymx=6)
wgs<-"+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"
projection(r.base) <- wgs
set.seed(0)
values(r.base) <- runif(ncell(r.base))
plot(r.base)

Code runs on a Windows server with R3.3.0, resulting in: Plot without color

On a private computer the plot funciton works fine, resulting the intented output: Plot with color

eliascis
  • 317
  • 2
  • 10

1 Answers1

0

Check if the colour quality of your computer graphic card is set to the highest, for example, 32-bit. Lower quality (16-bit) may result in no colour in the plots produced by the package "raster".

Hadi Pourbagher
  • 151
  • 1
  • 5