はじめに
matplotlib mplot3dで自己交差性を持つ曲面であるエンネパー曲面を3Dグラフ上に表示する方法について説明する。
コード

解説
モジュールのインポートなど
バージョン
データの生成
媒介変数でデータを作成する。
plot_surfaceによる曲面の表示
plot_surfaceにより表示すると以下のようになる。ax.set_box_aspect((1,1,1))によりアスペクト比を揃えている。

回転アニメーションで表示
ax.view_initを変化させることで図を回転することができる。詳細は下記記事と同様にした。

[matplotlib 3D] 14. 3Dグラフの回転アニメーション
matplotlib mplot3d のグラフの回転アニメーション
参考

エンネパー曲面 - Wikipedia
コメント