2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MatplotlibでJpegで保存できない時

Posted at

■環境
Windows10
Python 3.7
matplotlib 3.1.1
pycharm

■内容
以下のようにmatplotlibでJPEGで画像を保存しようとすると

 Fig.savefig(”Test.jpg", bbox_inches="tight")

こんなエラーがでるときがあります。

 ValueError: Format 'jpg' is not supported (supported formats: eps, pdf, pgf, png, ps, raw, rgba, svg, svgz)

■解決策
このときは、pillow をインストールすれば解消します。

  py -m pip install pillow

■参考ページ
https://stackoverflow.com/questions/48186616/open-a-jpg-image-in-python-using-matplotlib-image-in-python-3-6

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?