[ 
Note the difference in color scale in the two images. top image is the result from R 3.2.5, the same code creates the bottom image in R 2.15.2. I want to allow the "change" of labels in the upper graph, so that it matches the bottom. The sample code provided in this request was used to create both charts.
I am trying to build a map using image.plot, but the minimum and maximum colorscale values ββdo not display exactly on the hints. I ran into this problem in R version 3.2.5 (2016-04-14); Platform: x86_64-w64-mingw32 / x64 (64-bit version) and the library package fields "Spam version 1.4-0 (2016-08-29)
On the contrary, the same commands could correctly display the min and max values ββat the edges of the color scale in R version 2.15.2 (2012-10-26), platform: x86_64-w64-mingw32 / x64 (64-bit) and "fields" 0.41- 0 (2014-02-26). Here is a sample code:
library(fields) temp <- matrix(data=rexp(200, rate=10), nrow=180, ncol=360) min(temp) max(temp) color_plate <- c("#FF0000", "#FF4D00", "#FF7000", "#FF8A00", "#FFA800", "#FFBF00", "#FFF000", "#FFFF54", "#AAFFFF","#7FFFFF", "#55FFFF", "#2AFFFF", "#00CFFF", "#20BFFF", "#209FFF", "#2060FF") zlim <- seq(0.08,0.40,by=0.04) temp[temp<min(zlim)] <- min(zlim) temp[temp>max(zlim)] <- max(zlim) image.plot(temp,col=color_plate, axis.args=list(cex.axis =1,at=zlim, labels=zlim,mgp=c(1, 0, 0),tck=0.1))
r plot
Munish
source share