8000 ImageGrid in 3.0 · Issue #12505 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

ImageGrid in 3.0 #12505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Phlya opened this issue Oct 12, 2018 · 3 comments
Closed

ImageGrid in 3.0 #12505

Phlya opened this issue Oct 12, 2018 · 3 comments
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. status: duplicate
Milestone

Comments

@Phlya
Copy link
Contributor
Phlya commented Oct 12, 2018

Bug report

Bug summary

ImageGrid seems to be broken on 3.0.0?

Code for reproduction

f = plt.figure()
grid = ImageGrid(f, 111, 
                 nrows_ncols=(2, 2),
                 direction='column',
                 label_mode="L",
                 cbar_location="right",
                 cbar_mode="single",
                 cbar_size="5%",
                 cbar_pad="3%"
                 )
axarr = np.array(grid).reshape(2, 2)
for ax in axarr.flatten():
    m = ax.imshow(np.random.random(15**2).reshape((15, 15))+0.5, 
           norm=LogNorm(vmax=2, vmin=0.5), cmap='coolwarm')
plt.colorbar(m, cax=grid.cbar_axes[0], format=FormatStrFormatter('%.2f'))

Actual outcome
image

Expected outcome
From 2.2.2
image

Note: if I remove all colorbar-related code, it again looks weird, but in a different way:

f = plt.figure()
grid = ImageGrid(f, 111,  
                 nrows_ncols=(2, 2),
                 direction='column',
                 label_mode="L",
                 )
axarr = np.array(grid).reshape(2, 2)
for ax in axarr.flatten():
    m = ax.imshow(np.random.random(15**2).reshape((15, 15))+0.5, 
           norm=LogNorm(vmax=2, vmin=0.5), cmap='coolwarm')

image

Seems like maybe all axes take up the whole figure, and so cover the rest?.. Just a guess.

Matplotlib version

  • Operating system: Ubuntu 16.04
  • Matplotlib version: 3.0.0
  • Matplotlib backend (print(matplotlib.get_backend())): inline
  • Python version: 3.5.2
  • Jupyter version (if applicable): Jupyter Lab 0.33.6
@tacaswell tacaswell added this to the v3.0.x milestone Oct 12, 2018
@tacaswell
Copy link
Member

attn @jklymak

@tacaswell tacaswell added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Oct 12, 2018
@jklymak
Copy link
Member
jklymak commented Oct 12, 2018

Duplicate #12355. See fix in #12363

@tacaswell
Copy link
Member

Great! Just merged #12363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. status: duplicate
Projects
None yet
Development

No branches or pull requests

3 participants
0