「Matplotlib tips」の版間の差分
提供: Eospedia
行1: | 行1: | ||
+ | == 参考文献 == | ||
+ | * [https://matplotlib.org/tutorials/index.html 公式チュートリアル] | ||
+ | * [https://qiita.com/skotaro/items/08dc0b8c5704c94eafb9 早く知っておきたかったmatplotlibの基礎知識、あるいは見た目の調整が捗るArtistの話] | ||
+ | |||
== JupyterLabでインタラクティブプロット == | == JupyterLabでインタラクティブプロット == | ||
* 下準備 | * 下準備 |
2020年10月29日 (木) 05:59時点における版
参考文献
JupyterLabでインタラクティブプロット
- 下準備
- ipympl( https://github.com/matplotlib/ipympl )をインストール
- 使い方
- ノートブックの冒頭で以下のマジックコマンドをたたく
%matplotlib widget
始めにinlineにしておいて途中からwidgetに変えるとかは無理。最初から冒頭でwidgetにしておく必要あり。
3Dプロット
Axes3D
- インポート
from mpl_toolkits.mplot3d import Axed3D import matplotlib.pyplot as plt
- 使い方
fig = plt.figure() ax = fig.add_subplot(111, projection='3d')
- axはAxes3Dというクラスのインスタンスになっていて、3Dプロット用のメソッドを持っている。
- %matplotlib widget と一緒に使うと、3Dプロットの回転とかがマウスドラッグで可能。