はじめに
matplotlib mplot3dの3DボクセルグラフでRGB色空間を表示する。
コード

解説
RGB cubeは下記記事を参考にして作成した。

[matplotlib 3D] 30. voxelグラフでRGB色空間を可視化
matplotlibのvoxelグラフで各ボクセルの色を変化させる例として、グラフで各座標位置の値に対応するrgbを当てはめた球を表示する。
上記記事と異なる部分は、以下のようになる。
回転アニメーション
回転アニメーションは下記記事を参考にし、作成した。

[matplotlib 3D] 14. 3Dグラフの回転アニメーション
matplotlib mplot3d のグラフの回転アニメーション
参考
3D voxel / volumetric plot with rgb colors — Matplotlib 3.1.2 documentation
コメント