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
[Bug]: Saving a NonUniformImage with bbox_inches="tight" raises TypeError when extent is omitted #32707
I can save an image on an unevenly spaced grid with fig.savefig("grid.png"). When I add bbox_inches="tight" to trim the margins, saving the same figure raises a TypeError.
Tight export should save the same grid with the margins trimmed, and both layout modes should draw it successfully. Passing the grid bounds explicitly as extent lets me save with bbox_inches="tight".
Additional information
After set_data, im.get_extent() already returns (0, 4, 0, 4) for the grid in the script. The inherited AxesImage.get_window_extent() reads self._extent, which is still None. Calling fig.tight_layout() or saving with constrained layout hits the same error.
A comment on #8426 mentioned seeing this with NonUniformImage and gave a hist2d example. PR #9442 set the extent in pcolorfast. The example above constructs the image directly.
Activity