proplot-dev / proplot

🎨 A succinct matplotlib wrapper for making beautiful, publication-quality graphics
https://proplot.readthedocs.io
MIT License
1.07k stars 96 forks source link

Parameter share not properly set using Figure.add_subplots #392

Open cvanelteren opened 1 year ago

cvanelteren commented 1 year ago

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