Closed
Description
Bug summary
I am plotting with imshow()
and create a colorbar. When saving the figure as .eps with savefig()
and option bbox_inches='tight'
, the colorbar (without the spines) is displaced.
Code for reproduction
import matplotlib.pyplot as plt
fig = plt.figure()
plt.imshow([[1, 1], [1, 1]])
plt.colorbar()
plt.savefig("test.eps", bbox_inches='tight')
plt.show()
Expected outcome
Colorbar should be placed inside the spines as when using plt.show()
. Also, saving as .png instead of .eps works correctly.
Actual outcome
Additional information
The bug does not happen when using Matplotlib version 5.2.3.
Operating system
Windows 10
Matplotlib version
3.6.3
Matplotlib backend
module://backend_interagg
Python version
3.11.0