I have three arrays
theta
array([180., 180., 180., 180., 180., 180., 180., 180., 180., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 225., 225., 225.,
225., 225., 225., 225., 225., 225., 45., 45., 45., 45., 45.,
45., 45., 45., 45., 45., 270., 270., 270., 270., 270., 270.,
270., 270., 270., 90., 90., 90., 90., 90., 90., 90., 90.,
90., 90., 315., 315., 315., 315., 315., 315., 315., 315., 315.,
135., 135., 135., 135., 135., 135., 135., 135., 135., 135.])
phi
array([45. , 39.98823529, 35.01176471, 30. , 24.98823529,
20.01176471, 15. , 9.98823529, 5.01176471, 0. ,
5.01176471, 9.98823529, 15. , 20.01176471, 24.98823529,
30. , 35.01176471, 39.98823529, 45. , 45. ,
39.98823529, 35.01176471, 30. , 24.98823529, 20.01176471,
15. , 9.98823529, 5.01176471, 0. , 5.01176471,
9.98823529, 15. , 20.01176471, 24.98823529, 30. ,
35.01176471, 39.98823529, 45. , 45. , 39.98823529,
35.01176471, 30. , 24.98823529, 20.01176471, 15. ,
9.98823529, 5.01176471, 0. , 5.01176471, 9.98823529,
15. , 20.01176471, 24.98823529, 30. , 35.01176471,
39.98823529, 45. , 45. , 39.98823529, 35.01176471,
30. , 24.98823529, 20.01176471, 15. , 9.98823529,
5.01176471, 0. , 5.01176471, 9.98823529, 15. ,
20.01176471, 24.98823529, 30. , 35.01176471, 39.98823529,
45. ])
violet_ints
array([ 60821.47285091, 71469.47778826, 81950.58139812, 92660.95741024,
103228.07719577, 113446.6171393 , 123862.48451513, 132666.65201113,
138673.94497866, 141418.87424494, 140947.68057807, 137704.80141046,
131712.10023037, 122871.74227686, 111022.93897237, 98051.87876927,
85884.71515151, 74789.81179595, 64223.21535332, 47239.6029958 ,
59060.46569283, 71631.51992138, 85056.88727878, 97838.32318773,
110985.04206186, 123046.60805235, 131994.74029036, 138009.81758468,
141092.29699058, 141436.99265739, 139367.40863866, 134564.53259257,
127256.22737589, 117476.56579378, 105893.78184852, 94434.79559289,
83012.77977437, 71513.83906988, 35465.27768276, 52489.59008641,
70259.4064192 , 87011.24343702, 101845.51856053, 114496.37908394,
125113.38041456, 132956.15831876, 138245.26502938, 140988.36471711,
141467.04309028, 139302.73813352, 135346.73647267, 128688.98045284,
120273.38645452, 110273.45442647, 99177.33744858, 87341.78739578,
74874.97094334, 50986.33091372, 63371.63698099, 76937.62936534,
91341.43206481, 105418.35862792, 117371.0063522 , 127397.07283259,
134693.40421132, 139258.98685025, 141392.73492377, 140797.81487188,
137360.21016255, 130967.39590833, 122385.40640793, 113290.91743172,
103305.45203984, 93133.15852394, 82350.70121816, 71046.51493323])
I made a polar plot with these arrays
plt.figure(figsize=(10, 20))
ax = plt.axes(projection='polar')
axx = ax.scatter(theta*np.pi/180, phi, c=violet_ints,
cmap='viridis')
plt.colorbar(axx, shrink = 0.4);
Now I want to interpolate these data so that I can get a color mesh plot like this one.
Interpolated plot:

I tried to convert my arrays into meshgrids
Theta, Phi = np.meshgrid(theta, phi)
_, Violet_Ints = np.meshgrid(violet_ints, violet_ints)
However when I try to make a plot using pcolormesh, it does not make sense
plt.figure(figsize=(10, 20))
ax = plt.axes(projection='polar')
ax.pcolormesh(Theta*np.pi/180, Phi, Violet_Ints,
cmap='viridis');
My attempt to plot meshgrid:

Can you guys help me with this one, please?
The main thing you're missing is that
pcolormeshattempts to interpolate between adjacent values. This means that the sortedness of your data is important. Once you fix that, you'll need to do a littlenumpyto ensure you satisfy the coordinate system that.pcolormeshneeds.Using your variables from above: