theta2, r2 = cart2polar(x2, y2)
H, theta_edges, r_edges = np.histogram2d(theta2, r2)
ax2.contour(theta_edges[:-1], r_edges[:-1], H)
How can I draw a scatter plot with contour density lines in polar coordinates using Matplotlib?