8000 missing imshow() subplots when using tight_layout() · Issue #4976 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
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

Appearance settings
missing imshow() subplots when using tight_layout() #4976
Closed
@douglase

Description

@douglase

Hello, I've found an unexpected behavior when I make grids of subplots with imshow and tight_layout the second to last plot is missing, for example:

import numpy as np
import matplotlib.pyplot as plt
plt.figure()
for i in range(16):
    ax= plt.subplot(4,4 ,i+1)
    im=ax.imshow(np.random.normal(size=100).reshape([10,10]))
    plt.tight_layout()
    plt.title(i)
plt.savefig("imshow_4x4.png")

generates:
imshow_4x4
Whereas the same loop with pcolor works:

import numpy as np
import matplotlib.pyplot as plt
plt.figure()
for i in range(16):
    ax= plt.subplot(4,4 ,i+1)
    im=ax.pcolor(np.random.normal(size=100).reshape([10,10]))
    plt.tight_layout()
    plt.title(i)
plt.savefig("pcolor_4x4.png")

gives:
pcolor_4x4

If I omit the tight_layout() call from the first example it works:
imshow_nottight_4x4

I'm using matplotlib 1.4.3 and numpy 1.9.2 in Anaconda 2.2.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0