I want to plot a large number of data points on a polar scatter plot. I know how my data looks like from a cartesian plot, and I quickly noticed it got distorted on the polar plot. Now if I just plot the grid over which the data is plotted, it is already non-regular and distorted.
This is my code:
import numpy as np
import matplotlib.pyplot as plt
azimuths = np.linspace(0,2*np.pi,2000) # azimuthal angles
zeniths = np.linspace(0,100,200) # zenith is basically the radial extent of the plot
phi,r = np.meshgrid(azimuths,zeniths) # make the grid for the polar plot
fig, ax = plt.subplots(subplot_kw=dict(projection='polar'),figsize=(10,10)) # initialize figure
j=ax.scatter(phi,r,s=0.01) # make scatter plot
ax.set_rlim(0,100) # set radial limits
which yields the following figure:
I wonder if someone knows a way to create a uniform grid over the polar plot where no weird ripples appear, for this number of data points.
Increase the dpi parameter - the default is 100. Also consider increasing the figsize. The ripple effect is a display glitch, so this should fix things.
fig, ax = plt.subplots(subplot_kw=dict(projection='polar'),figsize=(10,10), dpi=200)
Check out the docs for this here.