@@ -4465,7 +4465,7 @@ def invalid_shape_exception(csize, xsize):
44654465 @_docstring .interpd
44664466 def scatter (self , x , y , s = None , c = None , marker = None , cmap = None , norm = None ,
44674467 vmin = None , vmax = None , alpha = None , linewidths = None , * ,
4468- edgecolors = None , plotnonfinite = False , markersize = None , ** kwargs ):
4468+ edgecolors = None , plotnonfinite = False , markerscale = 2 , ** kwargs ):
44694469 """
44704470 A scatter plot of *y* vs. *x* with varying marker size and/or color.
44714471
@@ -4545,10 +4545,9 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
45454545 or ``nan``). If ``True`` the points are drawn with the *bad*
45464546 colormap color (see `.Colormap.set_bad`).
45474547
4548- markersize : float or array-like, shape (n, ), optional
4549- The marker size in points. This differs from `s` as it sets the
4550- size directly in points instead of points**2. `s` is used by
4551- default to set the size if neither are passed.
4548+ markerscale : 1 or 2, optional, default: 2
4549+ Scaling factor used to set the size as points or points**2.
4550+ Default value is set as 2 to set the size values as points**2.
45524551
45534552 Returns
45544553 -------
@@ -4589,19 +4588,18 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
45894588 if x .size != y .size :
45904589 raise ValueError ("x and y must be the same size" )
45914590
4592- if s is not None and markersize is not None :
4591+ if s is not None and ' markersize' in kwargs :
45934592 raise ValueError (
4594- "Only one of s or markersize should be passed. "
4593+ "Only one of `s` or ` markersize` should be passed. "
45954594 "Please refer to the docs for more details about usage." )
45964595
45974596 if s is None :
4598- s = (20 if mpl .rcParams ['_internal.classic_mode' ] else
4599- mpl .rcParams ['lines.markersize' ] ** 2.0 )
4597+ if 'markersize' not in kwargs :
4598+ s = (20 if mpl .rcParams ['_internal.classic_mode' ] else
4599+ mpl .rcParams ['lines.markersize' ] ** 2.0 )
4600+ else :
4601+ s = kwargs .pop ('markersize' )
46004602 s = np .ma .ravel (s )
4601- markerscale = 2
4602- if markersize is not None :
4603- s = np .ma .ravel (markersize )
4604- markerscale = 1
46054603 if (len (s ) not in (1 , x .size ) or
46064604 (not np .issubdtype (s .dtype , np .floating ) and
46074605 not np .issubdtype (s .dtype , np .integer ))):
0 commit comments