This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Breaks Of Colors Do Not Match With Breaks Of Labels In R?

I plot a raster file(matrix) but found that the breaks of colours do not match with breaks of labels in the legend.

conne1 <- file("C:\\commond\\ates.bin","rb")
asc<- readBin(conne1, numeric(), size=4,  n=1440*720, signed=TRUE)
y<-t(matrix((data=asc), ncol=720, nrow=1440))
r = raster(y)
extent(r) = extent(c(xmn=-180,xmx=180,ymn=-90,ymx=90))
plot(r, col =  matlab.like(8),horizontal = TRUE, xlab="Longitude", lab.breaks=seq(-1,1,0.25),
    breaks=seq(-1,1,0.25),ylab="Latitude",legend.shrink = 0.9,legend.width = 1.2,
    main="",cex.lab=1.5, cex.axis=1.5, cex.main=1)

The plot is here:

http://s8.postimg.org/dgq9kgp2d/Rplot06.png

r plot

This example doesn't show that the breaks do not match, because it is not reproducible, I doubt that it is an error as you suggest. Could you provide a reproducible example, and explain how this is related to bioinformatics or computational biology, please?

I don't see a question.

0 answers

No answers yet.

Log in to answer this question.