1、代碼及相關資料下載地址:https://download.csdn.net/download/higher80/10502633
2、參考資料地址(如果下列網址打不開,可以看上面“1”中的文件,裏面有下載的網頁文件)
(1)使用python繪製三維圓柱網格模型圖——voxels函數的使用:https://www.jianshu.com/p/03ed963eb51a
(2)3D voxel / volumetric plot with rgb colors:https://matplotlib.org/gallery/mplot3d/voxels_rgb.html
(3)3D voxel / volumetric plot:https://matplotlib.org/gallery/mplot3d/voxels.html#d-voxel-volumetric-plot
3、關鍵是要用到 matplotlib 裏面的函數 voxels
4、matplotlib版本好像是2.2.1及以上版本;反正要求較高版本
5、程序運行後的顯示效果:
圖1
圖2