Skip to content

Commit af1e82c

Browse files
committed
Revert "Add 'color' and 'size' to arguments (pandas-dev#44856)"
This reverts commit 8a4abfa. # Conflicts: # doc/source/whatsnew/v1.5.0.rst # pandas/plotting/_core.py # pandas/tests/plotting/frame/test_frame_color.py
1 parent 2d6505b commit af1e82c

File tree

4 files changed

+4
-19
lines changed

4 files changed

+4
-19
lines changed

doc/source/whatsnew/v1.5.0.rst

-1
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,6 @@ Plotting
11551155
- Bug in :meth:`DataFrame.boxplot` that prevented passing in ``xlabel`` and ``ylabel`` (:issue:`45463`)
11561156
- Bug in :meth:`DataFrame.boxplot` that prevented specifying ``vert=False`` (:issue:`36918`)
11571157
- Bug in :meth:`DataFrame.plot.scatter` that prevented specifying ``norm`` (:issue:`45809`)
1158-
- The function :meth:`DataFrame.plot.scatter` now accepts ``color`` as an alias for ``c`` and ``size`` as an alias for ``s`` for consistency to other plotting functions (:issue:`44670`)
11591158
- Fix showing "None" as ylabel in :meth:`Series.plot` when not setting ylabel (:issue:`46129`)
11601159
- Bug in :meth:`DataFrame.plot` that led to xticks and vertical grids being improperly placed when plotting a quarterly series (:issue:`47602`)
11611160
- Bug in :meth:`DataFrame.plot` that prevented setting y-axis label, limits and ticks for a secondary y-axis (:issue:`47753`)

pandas/plotting/_core.py

-9
Original file line numberDiff line numberDiff line change
@@ -1630,11 +1630,6 @@ def scatter(self, x, y, s=None, c=None, **kwargs) -> PlotAccessor:
16301630
16311631
.. versionchanged:: 1.1.0
16321632
1633-
size : str, scalar or array-like, optional
1634-
Alias for s.
1635-
1636-
.. versionadded:: 1.5.0
1637-
16381633
c : str, int or array-like, optional
16391634
The color of each point. Possible values are:
16401635
@@ -1648,10 +1643,6 @@ def scatter(self, x, y, s=None, c=None, **kwargs) -> PlotAccessor:
16481643
16491644
- A column name or position whose values will be used to color the
16501645
marker points according to a colormap.
1651-
color : str, int or array-like, optional
1652-
Alias for c.
1653-
1654-
.. versionadded:: 1.5.0
16551646
16561647
**kwargs
16571648
Keyword arguments to pass on to :meth:`DataFrame.plot`.

pandas/tests/plotting/frame/test_frame.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
""" Test cases for DataFrame.plot """
12
from datetime import (
23
date,
34
datetime,
@@ -652,11 +653,6 @@ def test_plot_scatter(self):
652653
with pytest.raises(TypeError, match=msg):
653654
df.plot.scatter(y="y")
654655

655-
with pytest.raises(TypeError, match="Specify exactly one of `s` and `size`"):
656-
df.plot.scatter(x="x", y="y", s=2, size=2)
657-
with pytest.raises(TypeError, match="Specify exactly one of `c` and `color`"):
658-
df.plot.scatter(x="a", y="b", c="red", color="green")
659-
660656
# GH 6951
661657
axes = df.plot(x="x", y="y", kind="scatter", subplots=True)
662658
self._check_axes_shape(axes, axes_num=1, layout=(1, 1))

pandas/tests/plotting/frame/test_frame_color.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ def test_if_scatterplot_colorbars_are_next_to_parent_axes(self):
196196
assert np.isclose(parent_distance, colorbar_distance, atol=1e-7).all()
197197

198198
@pytest.mark.parametrize("cmap", [None, "Greys"])
199-
@pytest.mark.parametrize("kw", ["c", "color"])
200-
def test_scatter_with_c_column_name_with_colors(self, cmap, kw):
199+
def test_scatter_with_c_column_name_with_colors(self, cmap):
201200
# https://github.com/pandas-dev/pandas/issues/34316
202201

203202
df = DataFrame(
@@ -207,9 +206,9 @@ def test_scatter_with_c_column_name_with_colors(self, cmap, kw):
207206
df["species"] = ["r", "r", "g", "g", "b"]
208207
if cmap is not None:
209208
with tm.assert_produces_warning(UserWarning, check_stacklevel=False):
210-
ax = df.plot.scatter(x=0, y=1, cmap=cmap, **{kw: "species"})
209+
ax = df.plot.scatter(x=0, y=1, cmap=cmap, c="species")
211210
else:
212-
ax = df.plot.scatter(x=0, y=1, cmap=cmap, **{kw: "species"})
211+
ax = df.plot.scatter(x=0, y=1, c="species", cmap=cmap)
213212
assert ax.collections[0].colorbar is None
214213

215214
def test_scatter_colors(self):

0 commit comments

Comments
 (0)