8000 Backport of #11188: Fix image size in interpolation example · matplotlib/matplotlib@68e7965 · GitHub
[go: up one dir, main page]

Skip to content

Commit 68e7965

Browse files
jklymaktimhoffm
authored andcommitted
Backport of #11188: Fix image size in interpolation example
1 parent a2a908f commit 68e7965

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/images_contours_and_fields/interpolation_methods.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727

2828
grid = np.random.rand(4, 4)
2929

30-
fig, axes = plt.subplots(3, 6, figsize=(12, 6),
31-
subplot_kw={'xticks': [], 'yticks': []})
30+
fig, axs = plt.subplots(nrows=3, ncols=6, figsize=(9, 4.5),
31+
subplot_kw={'xticks': [], 'yticks': []})
3232

3333
fig.subplots_adjust(hspace=0.3, wspace=0.05)
3434

3535
for ax, interp_method in zip(axes.flat, methods):
3636
ax.imshow(grid, interpolation=interp_method, cmap='viridis')
3737
ax.set_title(interp_method)
3838

39+
plt.tight_layout()
3940
plt.show()

0 commit comments

Comments
 (0)
0