web-dev-qa-db-ja.com

matplotlibの境界線の幅

私はmatplotlib0.99を使用しています。

subplotの境界線の幅を変更できません。どうすればよいですか?

コードは次のとおりです。

fig = plt.figure(figsize = (4.1, 2.2))
ax = fig.add_subplot(111)

ax.patch.set_ linewidth(0.1) 
ax.get_frame().set_linewidth(0.1) 

最後の2行は機能しませんが、以下は正常に機能します。

legend.get_frame().set_ linewidth(0.1)
19
aaa

境界線のサイズを調整しますか? ax.spines [side] .set_linewidth(size)を使用する必要があります。

だから次のようなもの:

[i.set_linewidth(0.1) for i in ax.spines.itervalues()]
30
Mark

多分これはあなたが探しているものですか?

import matplotlib as mpl

mpl.rcParams['axes.linewidth'] = 0.1 #set the value globally

16
Timothy Dalton