image - How to include background into R plot? -


my code:

x <-sample(1:1484) y <-sample(1:1484)   library(hexbin) cols <- colorramppalette(c("darkorchid4","darkblue","green","yellow", "red") ) plot(hexbin(vel1,res1),colorcut = seq(0,1,length.out=24),colramp = function(n) cols(24)) 

counts in legend 1 seven(e.g).how include zero(white) in legend?

you change mincnt argument 0 , add "white" colramp function, adjusting number of colors returned cols function:

plot(hexbin(x,y), colorcut = seq(0,1,length.out=24), mincnt = 0,     colramp = function(n) c("white", cols(n - 1))) 

enter image description here


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -