'Rotate a 2D contour plot through 360 degrees to create 3D plot (Python, Mayavi/Matplotlib)
I have three 1D arrays, which represent radius, height, and an intensity measured at that point. I have plotted these to create a 2D contour map. A simple example of the way in which the data is stored is below:
import numpy as np
import matplotlib.pyplot as plt
x = [1,1,1,2,2,2,3,3,3]
y = [1,2,3,1,2,3,1,2,3]
intensity = [5,6,8,9,9,11,15,5,2]
plt.xlabel('Radius')
plt.ylabel('Height')
plt.tricontourf(x,y,intensity)
plt.colorbar(label='Intensity')
plt.show()
I've plotted this using Matplotlib as an example, but it's been suggested Mayavi might be better suited?
I want to create a 3D plot by 'sweeping' the 2D plot through 360 degrees, creating a disk which is azimuthally symmetric. See image below to explain the idea...
...with the data interpolated smoothly through the 360 degrees.
While there are no currently no questions that seem to duplicate this, this one is close to the kind of thing I need.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


