1

show()画面上で (インタラクティブなバックエンドを使用している場合) または'ed'にできる Figure オブジェクトを作成する必要がありますがsavefig()、pylab/pyplot API を使用しないようにする必要があります。私は図を次のように作成します

import matplotlib.figure
import matplotlib.backends.backend_qt4agg # or agg for headless backends
figure=matplotlig.figure.Figure()
canvas=matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg(figure)

しかし、私はまだ何かが欠けています。Figure.showのドキュメントには、

If the figure was not created using figure(), it will lack a FigureManagerBase, and will raise an AttributeError.

どうすればいいですか?

4

1 に答える 1