[matplotlib 3D] 27. 3D wireframeグラフでX軸方向またはY軸方向 のみのデータを表示

matplotlib 3D

はじめに

matplotlib mplot3dの3D wireframeグラフでX or Y 軸の一方向だけのデータを表示する方法について解説する。

コード

解説

モジュールのインポート

図の作成

subplot_kw={‘projection’: ‘3d’}は、add_subplot(111,projection=’3d’)とおなじ。

一方向wireframeグラフの作成

ccount, rcountをそれぞれ0とすることで、その方向にデータが非表示となる。

各方向で色を変えて描写

コードをダウンロード(.pyファイル)

コードをダウンロード(.ipynbファイル)

参考

https://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html
https://matplotlib.org/examples/mplot3d/wire3d_zero_stride.html

コメント