title: How do you annotate a matplotlib imshow map with an arrow *and* text?
body: <p>I am trying to make an illustration that looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/R5Mhq.png" alt="better image"></p>
  
  <p>But instead I get this:</p>
  
  <p><img src="https://i.stack.imgur.com/A7Q7U.png" alt="basic image"></p>
  
  <p>Here is my program:</p>
  
  <pre><code>from pylab import *
  from matplotlib import colors
  # A = [[1,2,3,4,5]]
  A = [[0],[1]]
  Amap = colors.ListedColormap(['blue','green'])
  
  figure(1)
  imshow(A, cmap=Amap, interpolation='nearest')
  annotate('AA BB',xy=(0,0), xytext=(.8,0), fontsize=20)
  axis('off')
  savefig('graph-py.pdf')
  show()
  </code></pre>
  
  <p>I've tried everything to get the arrow, but can't seem to make it happen. Any ideas?</p>