-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Description
Feature Type
-
Adding new functionality to pandas
-
Changing existing functionality in pandas
-
Removing existing functionality in pandas
Problem Description
I am contributing to anesthetic
, which extends pandas for plotting the results of nested sampling. It is very convenient that HistPlot._makeplot()
calls the class method self._plot()
which KdePlot
overrides, as our histograms can do the same and not worry about handling the rest of the formatting in _makeplot()
. It would be useful if ScatterPlot
worked similarly, so we could insert our own scatter.
Perhaps _scatter()
would be more appropriate than _plot()
in this case.
Feature Description
Extending ScatterPlot would look something like this:
from pandas.plotting._matplotlib.core import ScatterPlot
def my_scatter_method(ax, x, y, **kwds):
# additional processing appropriate for nested sampling
return ax.scatter(x, y, ...)
class MyScatterPlot(ScatterPlot):
@classmethod
def _scatter(cls, ax, x, y, **kwds):
return my_scatter_method(ax, x, y, **kwds)
Alternative Solutions
Currently we override ScatterPlot._makeplot()
, so we have to deal again with handling all the e.g. color arguments.
Additional Context
No response