Skip to content

Commit 331b2b3

Browse files
MarcoGorellimliu08
authored andcommitted
DEPR Enforce reversion of Size color aliases (pandas-dev#49836)
1 parent 14ac058 commit 331b2b3

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

doc/source/whatsnew/v1.5.3.rst

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Fixed regressions
1515
~~~~~~~~~~~~~~~~~
1616
- Fixed performance regression in :meth:`Series.isin` when ``values`` is empty (:issue:`49839`)
1717
- Fixed regression in :meth:`DataFrameGroupBy.transform` when used with ``as_index=False`` (:issue:`49834`)
18+
- Enforced reversion of ``color`` as an alias for ``c`` and ``size`` as an alias for ``s`` in function :meth:`DataFrame.plot.scatter` (:issue:`49732`)
1819
-
1920

2021
.. ---------------------------------------------------------------------------

pandas/plotting/_core.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -1681,19 +1681,7 @@ def scatter(self, x, y, s=None, c=None, **kwargs) -> PlotAccessor:
16811681
... c='species',
16821682
... colormap='viridis')
16831683
"""
1684-
size = kwargs.pop("size", None)
1685-
if s is not None and size is not None:
1686-
raise TypeError("Specify exactly one of `s` and `size`")
1687-
if s is not None or size is not None:
1688-
kwargs["s"] = s if s is not None else size
1689-
1690-
color = kwargs.pop("color", None)
1691-
if c is not None and color is not None:
1692-
raise TypeError("Specify exactly one of `c` and `color`")
1693-
if c is not None or color is not None:
1694-
kwargs["c"] = c if c is not None else color
1695-
1696-
return self(kind="scatter", x=x, y=y, **kwargs)
1684+
return self(kind="scatter", x=x, y=y, s=s, c=c, **kwargs)
16971685

16981686
def hexbin(
16991687
self, x, y, C=None, reduce_C_function=None, gridsize=None, **kwargs

0 commit comments

Comments
 (0)