matplotlibのholdについて

python + matplotlibでグラフを重ねる際、hold(True)を使っていると次のような警告が出る

 

Warning (from warnings module):
File "C:\Program Files\Python36\lib\site-packages\matplotlib\rcsetup.py", line 156
mplDeprecation)
MatplotlibDeprecationWarning: axes.hold is deprecated, will be removed in 3.0

 

警告なので別に動く

最新のversionではhold(True)をせずとも、holdが最初から機能している。

むしろ別々のグラフにしたいのであれば、cla()を使い、明示的にグラフを白紙に戻す必要がある。

らしい。

 

matplotlib.org

 

日本語で明記してある記事が出てこなかったので備忘録メモ