Skip to content

Type-check on axes-instances created with subplots() fails #8810

@Khris777

Description

@Khris777

Bug report

Bug summary

Creating an axes object using the subplots()-method creates an object of type matplotlib.axes._subplots.AxesSubplot, but the object can't be tested on this type, while an axes-object of type matplotlib.axes._axes.Axes can be tested successfully.

Code for reproduction

import matplotlib.pyplot as mp
import matplotlib.pyplot as mpp
fig,axes = mpp.subplots()
print(isinstance(axes,mp.axes._subplots.AxesSubplot))

Out: AttributeError: module 'matplotlib.axes._subplots' has no attribute 'AxesSubplot'

Compared to:

fig = mpp.Figure()
axes = fig.add_axes([0,0,1,1])
print(isinstance(axes,mp.axes._axes.Axes))

Out: True

Matplotlib version
Windows 10
Matplotlib 2.0.2
Python 3.6.1
Anaconda Distribution

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