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を使ったデータ分析、機械学習
254
4
章 
Matplotlib
による可視化
図4-43 2列の凡例
角丸(
fancybox
)を使用する、影を付ける、フレームの透明度(
alpha
値)を上げる、テキストの
周囲の余白を変更することも可能です( 4-44)。
In[6]: ax.legend(fancybox=True, framealpha=1, shadow=True, borderpad=1)
fig
図4-44 角丸を使った凡例
詳細な凡例のオプションについては、
plt.legend
docstring
を参照してください。
4.8.1
 凡例要素の選択
既に説明したように、凡例にはデフォルトですべてのラベル付き要素を含みます。これが望まし
くない場合は、
plot
メソッドが返したオブジェクトを使用して、凡例に表示する要素とラベルを
微調整できます。
plt.plot()
メソッドは、一度に複数の線を作成し、作成した線インスタンスの
リストを返します。これらのいずれかをラベル指定と共に
plt.legend()
に渡すと、その線インス
タンスの凡例が表示されます( 4-45)。
In[7]: y = np.sin(x[:, np.newaxis] + np.pi * np.arange(0, 2, 0.5))
4.8
 凡例のカスタマイズ
255 ...
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