PolarColor map plot of grid data in Pyhton
<p>I want to plot a color map of a grid data, grid in polar form. In data, r ranges from 1 to 2 and theta 0 to 360. I want map like this:</p>

<p><a href="http://i.stack.imgur.com/NEFQ0.png" rel="nofollow"><img src="http://i.stack.imgur.com/NEFQ0.png" alt="enter image description here"></a>
    I plotted like this </p>

<pre><code>#x1 of shape(12,)
#y1 0f shape(36,1)
#z of shape(36,12)
fig=plt.figure()  
ax=fig.add_subplot(111) #Output Figure 1
#ax=fig.add_subplot(111,polar='True') #Output Figure 2
ax=fig.add_subplot(111)
ax.pcolor(y1,x1,z)
plt.show()
</code></pre>

<p>Output:
<a href="http://i.stack.imgur.com/INPNp.png" rel="nofollow"><img src="http://i.stack.imgur.com/INPNp.png" alt="enter image description here"></a></p>

<p><a href="http://i.stack.imgur.com/38RkJ.png" rel="nofollow"><img src="http://i.stack.imgur.com/38RkJ.png" alt="enter image description here"></a></p>

<p>Any idea how to plot the above figure? I also tried converting r, theta into x,y then i got color map in r&lt;1 range which i don't want.</p>

<p>As pointed out <a href="http://stackoverflow.com/a/6457331/6935985">here</a>, <code>pcolormesh()</code> is useful for this.</p>

<pre><code>import matplotlib.pyplot as plt
import numpy as np

theta = np.linspace(0, 2*np.pi, 36)
r = np.linspace(1, 2, 12)

R, THETA = np.meshgrid(r, theta)
Z = np.sin(THETA) * R

plt.subplot(111, projection='polar')
plt.pcolormesh(THETA, R, Z)
plt.gca().set_rmin(0.0)

plt.show()
</code></pre>

<p><a href="http://i.stack.imgur.com/U9lbj.png" rel="nofollow">output figure</a></p>

python matlab matplotlib