Skip to content

Commit ac02f83

Browse files
committed
Merge pull request #133 from jseabold/fix-subplot-squeeze
Patched pyplot.subplots for squeeze==False
2 parents 7c1cd9b + 23ac081 commit ac02f83

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/pyplot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,9 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
829829
ret = fig, axarr[0,0]
830830
else:
831831
ret = fig, axarr.squeeze()
832-
832+
else:
833+
# returned axis array will be always 2-d, even if nrows=ncols=1
834+
ret = fig, axarr.reshape(nrows, ncols)
833835

834836
return ret
835837

0 commit comments

Comments
 (0)