I already asked a question here: Contour plot on the surface of a 3D cylinder
But I didn't get an answer so I am trying another approach. I would like to plot a contour plot with data across the radius. I think I almost did it but there is one problem. First my code and how the plot looks like now: Contour Plot
import numpy as np
import matplotlib.pyplot as plt
xlist = np.linspace(-40, 40)
ylist = np.linspace(-40, 40)
X, Y = np.meshgrid(xlist, ylist)
Z = np.sqrt(X ** 2 + Y ** 2 )
plt.figure()
#These are my values for a certain radius
levels = [15, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 34, 36, 37]
contour = plt.contourf(X, Y, Z, levels)
contour_filled = plt.contourf(X, Y, Z, levels)
plt.colorbar(contour_filled)
plt.show()
My problem is the radius. I would like to visualize a certain value (e.g. 15) on the radius of 150 as a certain color (e.g. blue).In my plot the value 15 represents the radius 15. I hope you guys know what I mean... Maybe the function contour is the wrong approach?? But is there a possibility to get a similar plot (with all the nice filled colors) with another function?
Best regards