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

Skip to content

Commit 8115e68

Browse files
committed
Merge pull request #2780 from tacaswell/subplot_errormsg
ENH : improve error invalid error message for subplot
2 parents d7a1389 + 61300dd commit 8115e68

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/figure.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,10 @@ def add_subplot(self, *args, **kwargs):
901901

902902
if len(args) == 1 and isinstance(args[0], int):
903903
args = tuple([int(c) for c in str(args[0])])
904+
if len(args) != 3:
905+
raise ValueError("Integer subplot specification must " +
906+
"be a three digit number. " +
907+
"Not {n:d}".format(n=len(args)))
904908

905909
if isinstance(args[0], SubplotBase):
906910

0 commit comments

Comments
 (0)