proplot icon indicating copy to clipboard operation
proplot copied to clipboard

Parameter share not properly set using Figure.add_subplots

Open cvanelteren opened this issue 3 years ago • 0 comments

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

cvanelteren avatar Sep 26 '22 09:09 cvanelteren