Skip to content

Commit a67ae8d

Browse files
committed
set default to 20 and raise PandasFutureWarning
1 parent 2e62132 commit a67ae8d

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

pandas/plotting/_matplotlib/core.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
)
2020
import warnings
2121

22-
import matplotlib as mpl
2322
import numpy as np
2423

2524
from pandas._libs import lib
26-
from pandas.errors import AbstractMethodError
25+
from pandas.errors import (
26+
AbstractMethodError,
27+
PandasFutureWarning,
28+
)
2729
from pandas.util._decorators import cache_readonly
2830
from pandas.util._exceptions import find_stack_level
2931

@@ -54,6 +56,7 @@
5456
)
5557
from pandas.core.dtypes.missing import isna
5658

59+
import matplotlib as mpl
5760
import pandas.core.common as com
5861

5962
from pandas.io.formats.printing import pprint_thing
@@ -81,18 +84,17 @@
8184
)
8285

8386
if TYPE_CHECKING:
84-
from matplotlib.artist import Artist
85-
from matplotlib.axes import Axes
86-
from matplotlib.axis import Axis
87-
from matplotlib.figure import Figure
88-
8987
from pandas._typing import (
9088
IndexLabel,
9189
NDFrameT,
9290
PlottingOrientation,
9391
npt,
9492
)
9593

94+
from matplotlib.artist import Artist
95+
from matplotlib.axes import Axes
96+
from matplotlib.axis import Axis
97+
from matplotlib.figure import Figure
9698
from pandas import (
9799
DataFrame,
98100
Index,
@@ -1325,18 +1327,18 @@ def __init__(
13251327
**kwargs,
13261328
) -> None:
13271329
if s is None:
1328-
# The default size of the elements in a scatter plot
1329-
# is now based on the rcParam ``lines.markersize``.
1330-
# This means that if rcParams are temporarily changed,
1331-
# the marker size changes as well according to mpl.rc_context().
1330+
# The default size of the elements in a scatter plot
1331+
# is 20, but this will change in a future version.
1332+
# In the future the value will be derived from
1333+
# mpl.rcParams["lines.markersize"] if not provided
13321334
warnings.warn(
1333-
"""The default of s=20 is deprecated and
1334-
has changed to mpl.rcParams['lines.markersize'].
1335-
Specify `s` to suppress this warning""",
1336-
DeprecationWarning,
1335+
"The default of s=20 will be changed to use "
1336+
"mpl.rcParams['lines.markersize'] in the future. "
1337+
"Specify `s` to suppress this warning",
1338+
PandasFutureWarning,
13371339
stacklevel=find_stack_level(),
13381340
)
1339-
s = mpl.rcParams["lines.markersize"] ** 2.0
1341+
s = 20
13401342
elif is_hashable(s) and s in data.columns:
13411343
s = data[s]
13421344
self.s = s

0 commit comments

Comments
 (0)