I would like to make a contour plot in polar coordinates, but I am not being able to do so. I took suggestion from an accepted answer of a similar question asked here, but that results in just plotting the axes and the contour is not plotted in my case.
I am attaching the code below:
def plotcnt():
import matplotlib.pyplot as plt
import numpy as np
azimuths = np.radians(np.linspace(0, 360, 360))
zeniths = np.arange(0, 2.1,20)
r,theta=np.meshgrid(zeniths,azimuths)
values= r*np.log(theta+2)
fig, ax = plt.subplots(subplot_kw=dict(projection='polar'))
ax.contourf(theta, r, values)
plt.show()
plotcnt()