如何在python中绘制圆柱体的二维切割槽

如何在python中绘制圆柱体的二维切割槽,python,plot,heatmap,Python,Plot,Heatmap,我有一个3D数组,其中包含Z、R和Phi容器中的值。我想在极坐标图中绘制R和Phi值(期望通过一个看起来像热图的圆柱体绘制一个切片) 看到另一篇帖子,我试着: import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np fig = plt.figure() ax = Axes3D(fig) rad = np.linspace(0, 4, 20) azm = np.lins

我有一个3D数组,其中包含Z、R和Phi容器中的值。我想在极坐标图中绘制R和Phi值(期望通过一个看起来像热图的圆柱体绘制一个切片)

看到另一篇帖子,我试着:

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np

fig = plt.figure()
ax = Axes3D(fig)

rad = np.linspace(0, 4, 20)
azm = np.linspace(0, 2 * np.pi, 10)
r, th = np.meshgrid(rad, azm)
z = np.mean(data, axis=0)
plt.subplot(projection="polar")

plt.pcolormesh(th, r, z)

plt.plot(azm, r, color='k', ls='none') 
plt.grid()
plt.colorbar()
plt.show()
但我没有得到我所期望的。我如何将数据可视化


p.S.这些值是圆柱形模型中的计分剂量,分为Z(30)、R(20)和φ(10)三个单元。

对于3d绘图,我建议使用mayavi