1. 程式人生 > >Python3.x+matplotlib(matplotlib版本好像是2.2.1及以上版本;反正要求較高版本)庫實現三維網格塊彩色顯示原始碼

Python3.x+matplotlib(matplotlib版本好像是2.2.1及以上版本;反正要求較高版本)庫實現三維網格塊彩色顯示原始碼

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