はじめに
matplotlib mplot3dの3DボクセルグラフでRGB色空間を表示する。
コード
![](https://sabopy.com/wp/wp-content/uploads/2020/01/3Dvoxel_rgb_cube_rgb000_axisequal.jpg)
解説
RGB cubeは下記記事を参考にして作成した。
![](https://sabopy.com/wp/wp-content/uploads/2020/01/3Dvoxel_rgb_edge_rgb000.jpg)
[matplotlib 3D] 30. voxelグラフでRGB色空間を可視化
matplotlibのvoxelグラフで各ボクセルの色を変化させる例として、グラフで各座標位置の値に対応するrgbを当てはめた球を表示する。
上記記事と異なる部分は、以下のようになる。
回転アニメーション
回転アニメーションは下記記事を参考にし、作成した。
![](https://sabopy.com/wp/wp-content/uploads/2018/10/Screenshot-2019-10-12-at-23.18.00-160x90.jpg)
[matplotlib 3D] 14. 3Dグラフの回転アニメーション
matplotlib mplot3d のグラフの回転アニメーション
参考
3D voxel / volumetric plot with rgb colors — Matplotlib 3.1.2 documentation
コメント