|
19 | 19 | ) |
20 | 20 | import warnings |
21 | 21 |
|
22 | | -import matplotlib as mpl |
23 | 22 | import numpy as np |
24 | 23 |
|
25 | 24 | from pandas._libs import lib |
26 | | -from pandas.errors import AbstractMethodError |
| 25 | +from pandas.errors import ( |
| 26 | + AbstractMethodError, |
| 27 | + PandasFutureWarning, |
| 28 | +) |
27 | 29 | from pandas.util._decorators import cache_readonly |
28 | 30 | from pandas.util._exceptions import find_stack_level |
29 | 31 |
|
|
54 | 56 | ) |
55 | 57 | from pandas.core.dtypes.missing import isna |
56 | 58 |
|
| 59 | +import matplotlib as mpl |
57 | 60 | import pandas.core.common as com |
58 | 61 |
|
59 | 62 | from pandas.io.formats.printing import pprint_thing |
|
81 | 84 | ) |
82 | 85 |
|
83 | 86 | 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 | | - |
89 | 87 | from pandas._typing import ( |
90 | 88 | IndexLabel, |
91 | 89 | NDFrameT, |
92 | 90 | PlottingOrientation, |
93 | 91 | npt, |
94 | 92 | ) |
95 | 93 |
|
| 94 | + from matplotlib.artist import Artist |
| 95 | + from matplotlib.axes import Axes |
| 96 | + from matplotlib.axis import Axis |
| 97 | + from matplotlib.figure import Figure |
96 | 98 | from pandas import ( |
97 | 99 | DataFrame, |
98 | 100 | Index, |
@@ -1325,18 +1327,18 @@ def __init__( |
1325 | 1327 | **kwargs, |
1326 | 1328 | ) -> None: |
1327 | 1329 | 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 |
1332 | 1334 | 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, |
1337 | 1339 | stacklevel=find_stack_level(), |
1338 | 1340 | ) |
1339 | | - s = mpl.rcParams["lines.markersize"] ** 2.0 |
| 1341 | + s = 20 |
1340 | 1342 | elif is_hashable(s) and s in data.columns: |
1341 | 1343 | s = data[s] |
1342 | 1344 | self.s = s |
|
0 commit comments