X Tutup
Skip to content

Inconsistent behaviour of subplots for one and more-than-one axes  #7246

@DSLituiev

Description

@DSLituiev

The pyplot.subplots returns inconsistent type of output dependent on the number of subplots requested. While this might be "convenient" sometimes, it is anti-intuitive and requires additional handling from the user side.

Suggestion: Return consistently numpy.ndarray of axes for any number of requested axes.

fig, axs = plt.subplots(2)
type(axs)
# numpy.ndarray

fig, axs = plt.subplots(1)
type(axs)
matplotlib.axes._subplots.AxesSubplot

[ ] Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)
'1.5.3'; Python 3.5, OSX

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup