Matplotlib

Matplotlib - GridSpecを使ってグラフを並べる

GridSpecの使い方 GridSpec demo 複数のグラフを並べる。グラフの大きさを変更できるので、大小のグラフを並べるのに便利。 import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec def annotate_axes(fig): for i, ax in enumerate(fig…

matplotlib - Color Names

References List of named colors — Matplotlib 3.5.2 documentation

Matplotlib - グラフのレイヤー順の調整

グラフの引数にzorder=<int>で指定する。 <int>の番号が小さい方が背景側。数字が大きい方が前面に出てくる。 References Zorder Demo — Matplotlib 3.5.2 documentation</int></int>

Matplotlib - グラフの指定領域を塗りつぶす

gist.github.com python.atelierkobato.com

Matplotlib - textの位置をグラフ内の相対位置で配置

textをグラフ内の相対位置で配置するときの方法。 デフォルトでは、グラフのx, y軸の値で指定するが、データによって範囲が違うのでうまく位置を合わせられないことがある。 # 右上の相対位置、横軸方向の0.7, 縦軸方向の0.8に ax.text(0.8, 0.8, '右上', tr…

Matplotlib - カラーバーの表示の仕方

以下の記事にsubplotでのcolorbarの表示方法。colorbarのラベルの付け方などが紹介されていた。 Reference helve-blog.com