Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Description
Bug summary
When usingmake_axes_locatable
to add a colorbar to an existing plot, when you specify the aspect ratio of the initial plot, the plot will shrink rather than expanding to fit the space so that the plot will be aligned with the colorbar.
Code for reproduction
fig,ax=plt.subplots()x=np.linspace(0,1,100).reshape((25,4))im=ax.imshow(x)ax.set_aspect(0.3)divider=make_axes_locatable(ax)cax=divider.append_axes('right',size="20%",pad="3%")fig.colorbar(im,cax=cax)plt.show()
Actual outcome
Expected outcome
It should look something similar to this, except with the data, limits and aspect ratio being the same as the previous image. The plot and the colorbar should align.
Operating system
Windows
Matplotlib Version
3.2.2
Matplotlib Backend
module://ipykernel.pylab.backend_inline
Python version
3.8.3
Jupyter version
3.0.14
Other libraries
No response
Installation
conda
Conda channel
No response