エラーメッセージのプロンプトに基づいて、ピクセルまたはインチのいずれかの方法を使用してggplotをファイルに保存するために、いくつかの反復バージョンを試しました。
ggsave(filename="nlrundiff.jpg", width=4, height=4, units='in', plot=plt)
どちらの場合も成功しません。結果のエラー メッセージの抜粋は次のとおりです。
/usr/local/lib/python2.7/dist-packages/ggplot/utils/ggutils.pyc in ggsave(filename, plot, device, format, path, scale, width, height, units, dpi, limitsize, **kwargs)
118 from_inch = {"in":lambda x:x,"cm":lambda x: x * 2.54, "mm":lambda x: x * 2.54 * 10}
119
--> 120 w, h = figure.get_size_inches()
121 issue_size = False
122 if width is None:
AttributeError: 'NoneType' object has no attribute 'get_size_inches'
これは私の側の入力構文エラーですか、それとも Python ggplot のバグですか?
ありがとう。