title: Label of Image Plot in R
body: <p>I am using <code>image.plot</code> in R. Here is my simple code:</p>
  
  <pre><code>x=1:30
  y=1:30
  z=matrix(rnorm(900),30,30)
  library(fields)
  image.plot(x,y,z,col=ifelse(z&lt;0,"red","blue"))
  </code></pre>
  
  <p>That gives me the following plot. How can I change the label on the right hand size to have just two colored horizontal bars:   </p>
  
  <p>red bar with the  text label of "negative" and<br>
  blue bar with the  text label of "positive"</p>
  
  <p><a href="https://i.stack.imgur.com/isUv2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/isUv2.jpg" alt="enter image description here"></a></p>