my matrix consists of values between 0 and 100 and has the dimensions of 100 x 100. I basically want to plot this matrix but colour all values above 50 in e.g. red and below in e.g. blue. On top of that I'd like to add a nice grayisch grid like they do it here with ggplot:
I am wondering what's the easiest way to achieve that? I am not sure if I want to give ggplot a try as it looks pretty complicated from what I have seen so far. Isn't there any other easy plot function for such a task?
In base graphics it is just:
image(x, col=c("red","blue")[1+(x>50)] )
To add the grid use:
grid(nx=100, ny=100, lty=1)