Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 551d35c

Browse files
committed
Patched pyplot.subplots for squeeze==False
1 parent 4152651 commit 551d35c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/pyplot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,9 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
799799
ret = fig, axarr[0,0]
800800
else:
801801
ret = fig, axarr.squeeze()
802+
else:
803+
# returned axis array will be always 2-d, even if nrows=ncols=1
804+
return fig, axarr.reshape(nrows, ncols)
802805

803806

804807
return ret

0 commit comments

Comments
 (0)