title: Plot Mandelbrot with matplotlib / pyplot / numpy / python
body: <p>I am new to python and learning by following Python "Scientific lecture notes Release 2013.1" tutorial. Please help me solve this Mandelbrot problem in the srcreenshot below (Pg 71). Please provide step-wise commands with explanation if possible because programming concepts are new to me.</p>
  
  <p><a href="http://dl.dropbox.com/u/50511173/mandelbrot.png">http://dl.dropbox.com/u/50511173/mandelbrot.png</a></p>
  
  <p>I tried to solve this as follows:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  x,y=np.ogrid[-2:1:10j,-1.5:1.5:10j]
  c=x + 1j*y
  z=0
  for g in range(50):
    z=z**2 + c
  
  plt.imshow(z.T, extent=[-2,1,-1.5,1.5])
  </code></pre>
  
  <p>I encountered the following error "TypeError: Image data can not convert to float"</p>
  
  <p>What does this error exactly mean and how to correct it? I am finding it difficult to understand the imshow() function. What do the individual terms inside imshow() mean?</p>
  
  <p>Thank You.</p>