Closed
Description
Bug report
Pillow 7.0.0 is unsupported by pyplot.savefig when saving as jpeg.
Code for reproduction
With Pillow 7.0.0 installed:
import matplotlib.pyplot as plt
plt.plot(range(10))
plt.savefig('testplot.jpg')
The outcome is an exception is thrown, as follows:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 722, in savefig
res = fig.savefig(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/matplotlib/figure.py", line 2180, in savefig
self.canvas.print_figure(fname, **kwargs)
File "/usr/local/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 2021, in print_figure
canvas = self._get_output_canvas(format)
File "/usr/local/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 1961, in _get_output_canvas
raise ValueError(
ValueError: Format 'jpg' is not supported (supported formats: eps, pdf, pgf, png, ps, raw, rgba, svg, svgz)
The expected outcome is that savefig saves a jpeg image without an exception. This works fine with Pillow 6.2.2 and lower.
Matplotlib version
- Operating system: Linux
- Matplotlib version: 3.1.2
- Python version: 3.8.1
Metadata
Metadata
Assignees
Labels
No labels