You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bbox_inches='tight' raises KeyError for JPG and TIF #109
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 commentedon 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 commentedon Jul 29, 2015
I got this error for .jpeg
tacaswell commentedon 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.