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

make_axes_locatable : Colorbar in the middle instead of bottom while saving a pdf, png. #12624

Closed
@navdeeprana

Description

@navdeeprana

cax added using make_axes_locatable shows up at the middle of the image, instead of bottom while saving figures. I have tried .png and .pdf . The output from plt.show() is correct.

python 3.6.6 :: Anaconda custom (64-bit)
numpy version 1.15.3
matplotlib version 3.0.0

Here's a minimal script, which reproduces the result

importnumpyasnpfrommatplotlibimportpyplotaspltfrommpl_toolkits.axes_grid1importmake_axes_locatableepsilon=np.random.rand(128,128)fig,ax=plt.subplots(figsize=(6,6))cax=make_axes_locatable(ax).append_axes('bottom',size='5%',pad=0.05)im=ax.imshow(epsilon,origin='lower')fig.colorbar(im,cax=cax,orientation='horizontal')fig.tight_layout()fig.savefig('test.png',dpi=200,bbox_inches='tight')plt.show()

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