Skip to content

Parameter share not properly set using Figure.add_subplots #392

@cvanelteren

Description

@cvanelteren

Description

The behavior of fig.add_subplots is not consistent with the documentation. The parameter share[x/y] is listed as an input parameter to Figure.add_subplots in the documentation, providing this as an input yields an AttributeError.

I tried tot track the chain of what is called. The subplots interface with the share[x/y] properties which are not set upon figure creation. Setting this property, prior to adding subplots, yields the expected behavior. A proposed fix could be to either
(a) remove the parameters from the documentation in add_subplots or
(b) add checks to update the figure parent based on the added subplot.

Steps to reproduce

import proplot as plt
fig = plt.figure()
ax = fig.add_subplots(layout, share = 0)

Expected behavior: [What you expected to happen]
Update the figure specs such that the proper axes are shared.

Actual behavior: [What actually happened]
Yields attribute error

Equivalent steps in matplotlib

None

Proplot version

matplotlib 3.5.3
proplot 0.9.5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions