Closed
Description
The following example using grid_spec.tight_layout
in combination with a color bar causes a RuntimeError
in tight_layout.py
:
import matplotlib
import matplotlib.pyplot as pyplot
fig = pyplot.figure()
grid_spec = matplotlib.gridspec.GridSpec(nrows=1, ncols=1)
ax = fig.add_subplot(grid_spec[0])
im = ax.imshow([[1, 2], [3, 4]])
pyplot.colorbar(im, use_gridspec=True)
grid_spec.tight_layout(fig)
fig.show()
raw_input("Press Enter to continue...")
Using pyplot.tight_layout()
instead of grid_spec.tight_layout()
works, but has the drawback that pyplot.tight_layout()
does not accept the rect
parameter.
Metadata
Metadata
Assignees
Labels
No labels