New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
figure.add_subplot(1311): ValueError: Illegal argument(s) to subplot: (1, 3, 1, 1) #2098
Comments
The documentation for subplot (http://matplotlib.org/api/pyplot_api.html?highlight=subplot#matplotlib.pyplot.subplot) does state that the maximum number of rows/columns/plot_number is 9. The problem is that anything other than three digits is ill-defined. The solution is to use the better approach of Closing as this is a wontfix, and the documentation is already pretty good. Cheers, |
Hi Phil, |
Yeah -- I tend to agree that a better error message would be nice here. Yet another way to help encourage people to use the multi-argument form... |
flagged so this gets an improved error message. |
Closes matplotlib#2098 If user passes in a not-three-digit integer, raise `ValueError` instead of letting the error propagate up from much farther down the stack
Closes matplotlib#2098 If user passes in a not-three-digit integer, raise `ValueError` instead of letting the error propagate up from much farther down the stack
I did call _figure.add_subplot(1311) which breaks:
File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 889, in add_subplot
a = subplot_class_factory(projection_class)(self, _args, *_kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/axes.py", line 8987, in init
raise ValueError('Illegal argument(s) to subplot: %s' % (args,))
ValueError: Illegal argument(s) to subplot: (1, 3, 1, 1)
Looks max height of the figure can be 9, that is subfigures will be 911, 912, 913, etc. Looks at least a check that the number is less than 999 would be meaningful. Ideally, something more clever like a REGEXP.
Happens on mpl-1.2.1.
The text was updated successfully, but these errors were encountered: