2017-09-11 12 views

答えて

1

使用figおよびaxは、object oriented interfaceの一部であり、可能な限り頻繁に使用する必要があります。古いpltインタフェースを使用して

も、ほとんどの場合で動作しますが、作成したとき、多くの数字を操作したり、それはすべてあなたの数字を追跡するのは非常にトリッキーになることができ軸:

に比べ

plt.figure() 
plt.plot(...)  # this implicitly modifies the axis created beforehand 
plt.xlim([0, 10]) # this implicitly modifies the axis created beforehand 
plt.show() 

fig, ax = plt.subplots(1, 1) 
ax.plot(...)   # this explicitly modifies the axis created beforehand 
ax.set_xlim([0, 10]) # this explicitly modifies the axis created beforehand 
plt.show() 
関連する問題