Skip to content

Commit 8dafe12

Browse files
authored
manual backport of DEPR Enforce reversion of Size color aliases (pandas-dev#49895)
1 parent 55e0e25 commit 8dafe12

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
@@ -1694,19 +1694,7 @@ def scatter(self, x, y, s=None, c=None, **kwargs) -> PlotAccessor:
16941694
... c='species',
16951695
... colormap='viridis')
16961696
"""
1697-
size = kwargs.pop("size", None)
1698-
if s is not None and size is not None:
1699-
raise TypeError("Specify exactly one of `s` and `size`")
1700-
elif s is not None or size is not None:
1701-
kwargs["s"] = s if s is not None else size
1702-
1703-
color = kwargs.pop("color", None)
1704-
if c is not None and color is not None:
1705-
raise TypeError("Specify exactly one of `c` and `color`")
1706-
elif c is not None or color is not None:
1707-
kwargs["c"] = c if c is not None else color
1708-
1709-
return self(kind="scatter", x=x, y=y, **kwargs)
1697+
return self(kind="scatter", x=x, y=y, s=s, c=c, **kwargs)
17101698

17111699
def hexbin(
17121700
self, x, y, C=None, reduce_C_function=None, gridsize=None, **kwargs

0 commit comments

Comments
 (0)