Closed yongrenjie closed 4 years ago
That would actually enable us to change the core plotting API, essentially combining stage() and mkplot() into one ax method. But that would mean we lose certain useful things like voffset, stacked, etc. I think it is more logical to retain the API
Benefit
Object-oriented code: ax.method(*args, **kwargs)
instead of pg.func(ax=ax, *args, **kwargs)
Drawback
Forcing user into one single ecosystem (e.g. use pg.subplots()
only, plt.subplots()
not allowed) and extra confusion over which is appropriate
On balance, I think it's better to not do so. One thing I like very much about penguins is how it works seamlessly with matplotlib (because everything is done using "native" matplotlib classes / functions). We can stick with functions instead of methods.
FWIW, seaborn made the same design choice as I did, so I feel a bit more confident that I'm right.
We’d need to override the return type of subplots as well.