Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: make_axes_locatable for colorbar acts strange with aspect ratio #21500

Open
@GoodStuff11

Description

@GoodStuff11

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

image

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.
image

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp