Skip to content

figure.add_subplot(1311): ValueError: Illegal argument(s) to subplot: (1, 3, 1, 1) #2098

Closed
@mmokrejs

Description

@mmokrejs

I did call _figure.add_subplot(1311) which breaks:

_ax1 = _figure.add_subplot(_ax1_num)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions