Traceback (most recent call last):
File "tif.py", line 8, in <module>
fig.savefig('test.jpg', bbox_inches='tight')
File "/Users/tom/Library/Python/2.6/site-packages/matplotlib/figure.py", line 1162, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/Users/tom/Library/Python/2.6/site-packages/matplotlib/backend_bases.py", line 1943, in print_figure
**kwargs)
File "/Users/tom/Library/Python/2.6/site-packages/matplotlib/backend_bases.py", line 1803, in print_jpg
return image.save(filename_or_obj, **options)
File "/Users/tom/Library/Python/2.6/site-packages/PIL/Image.py", line 1423, in save
raise KeyError(ext) # unknown extension
KeyError: ''
and same for TIFF files. If bbox_inches='tight' isn't supported, maybe a warning would be better?
@kilojoules What version of mpl are you using? If it is 1.4.x please create a new issue with a minimal case to reproduce, if it is older, please upgrade and check if you can reproduce on a current version.
Activity
leejjoon commented on May 11, 2011
The patch is applied to the v1.0.x branch and merged to the master.
tight_bbox is supported for jpg and tiff outputs. closes matplotlib#109.
kilojoules commented on Jul 29, 2015
I got this error for .jpeg
tacaswell commented on Jul 30, 2015
@kilojoules What version of mpl are you using? If it is 1.4.x please create a new issue with a minimal case to reproduce, if it is older, please upgrade and check if you can reproduce on a current version.