Skip to Content
Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習
book

Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

by Jake VanderPlas, 菊池 彰
May 2018
Intermediate to advanced
556 pages
13h 21m
Japanese
O'Reilly Japan, Inc.
Content preview from Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習
270
4
章 
Matplotlib
による可視化
sharex
sharey
を指定したことで、グリッドの内側のラベルが自動的に削除され簡潔になって
いる点に注目してください。メソッドの戻り値として得られる
ax
NumPy
配列として返され、標
準の配列インデクス表記を使用して目的の軸を指定できます( 4-64)。
In[7]: # axes are in a two-dimensional array, indexed by [row, col]
for i in range(2):
ax
2
次元配列として
[
,
]
指定可能
for j in range(3):
ax[i, j].text(0.5, 0.5, str((i, j)),
fontsize=18, ha='center')
fig
図4-64 グリッド内のサブプロットの特定
plt.subplot()
とは異なり、
plt.subplots()
Python
0
ベースインデクス付けと一貫していま
す。
4.10.4
plt.GridSpec
:より複雑な配置
単純なグリッドではなく、複数の行や列にまたがるサブプロットを作るには、
plt.GridSpec()
が最適なツールです。
plt.GridSpec()
オブジェクトを作成しただけではプロットを描画しません。
これは
plt.subplot()
が認識する単なるインターフェースです。例えば、幅と高さを指定した
2
3
列のグリッドの
gridspec
は、次のように作成します。
In[8]: grid = ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Jake VanderPlas, 菊池 彰
初めてのGraphQL ―Webサービスを作って学ぶ新世代API

初めてのGraphQL ―Webサービスを作って学ぶ新世代API

Eve Porcello, Alex Banks, 尾崎 沙耶, あんどうやすし

Publisher Resources

ISBN: 9784873118413Other