From 49e73a8553cd3f99d3d3b3a774fde87a140817dc Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Wed, 23 Nov 2022 22:09:11 +0000 Subject: [PATCH] manual backport of DEPR Enforce reversion of Size color aliases --- doc/source/whatsnew/v1.5.3.rst | 1 + pandas/plotting/_core.py | 14 +------------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/doc/source/whatsnew/v1.5.3.rst b/doc/source/whatsnew/v1.5.3.rst index d35d3bf8b89ca..23ef342383f39 100644 --- a/doc/source/whatsnew/v1.5.3.rst +++ b/doc/source/whatsnew/v1.5.3.rst @@ -14,6 +14,7 @@ including other versions of pandas. Fixed regressions ~~~~~~~~~~~~~~~~~ - Fixed performance regression in :meth:`Series.isin` when ``values`` is empty (:issue:`49839`) +- Enforced reversion of ``color`` as an alias for ``c`` and ``size`` as an alias for ``s`` in function :meth:`DataFrame.plot.scatter` (:issue:`49732`) - .. --------------------------------------------------------------------------- diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index e1dba8ba58da1..be77de2c5a430 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -1694,19 +1694,7 @@ def scatter(self, x, y, s=None, c=None, **kwargs) -> PlotAccessor: ... c='species', ... colormap='viridis') """ - size = kwargs.pop("size", None) - if s is not None and size is not None: - raise TypeError("Specify exactly one of `s` and `size`") - elif s is not None or size is not None: - kwargs["s"] = s if s is not None else size - - color = kwargs.pop("color", None) - if c is not None and color is not None: - raise TypeError("Specify exactly one of `c` and `color`") - elif c is not None or color is not None: - kwargs["c"] = c if c is not None else color - - return self(kind="scatter", x=x, y=y, **kwargs) + return self(kind="scatter", x=x, y=y, s=s, c=c, **kwargs) def hexbin( self, x, y, C=None, reduce_C_function=None, gridsize=None, **kwargs