@@ -1127,6 +1127,13 @@ def bar(self, x=None, y=None, **kwargs):
1127
1127
axis of the plot shows the specific categories being compared, and the
1128
1128
other axis represents a measured value.
1129
1129
"""
1130
+ c = kwargs .pop ('c' , None )
1131
+ color = kwargs .pop ('color' , None )
1132
+ if c is not None and color is not None :
1133
+ raise TypeError ("Specify exactly one of `c` and `color`" )
1134
+ if c is not None or color is not None :
1135
+ kwargs .setdefault ('c' , color or c )
1136
+
1130
1137
return self (kind = "bar" , x = x , y = y , ** kwargs )
1131
1138
1132
1139
@Appender (
@@ -1213,6 +1220,13 @@ def barh(self, x=None, y=None, **kwargs):
1213
1220
axis of the plot shows the specific categories being compared, and the
1214
1221
other axis represents a measured value.
1215
1222
"""
1223
+ c = kwargs .pop ('c' , None )
1224
+ color = kwargs .pop ('color' , None )
1225
+ if c is not None and color is not None :
1226
+ raise TypeError ("Specify exactly one of `c` and `color`" )
1227
+ if c is not None or color is not None :
1228
+ kwargs .setdefault ('c' , color or c )
1229
+
1216
1230
return self (kind = "barh" , x = x , y = y , ** kwargs )
1217
1231
1218
1232
def box (self , by = None , ** kwargs ):
@@ -1582,7 +1596,7 @@ def pie(self, **kwargs):
1582
1596
raise ValueError ("pie requires either y column or 'subplots=True'" )
1583
1597
return self (kind = "pie" , ** kwargs )
1584
1598
1585
- def scatter (self , x , y , size = None , s = None , color = None , c = None , ** kwargs ):
1599
+ def scatter (self , x , y , ** kwargs ):
1586
1600
"""
1587
1601
Create a scatter plot with varying marker point size and color.
1588
1602
@@ -1601,7 +1615,7 @@ def scatter(self, x, y, size=None, s=None, color=None, c=None, **kwargs):
1601
1615
y : int or str
1602
1616
The column name or column position to be used as vertical
1603
1617
coordinates for each point.
1604
- size : str, scalar or array-like, optional
1618
+ s : str, scalar or array-like, optional
1605
1619
The size of each point. Possible values are:
1606
1620
1607
1621
- A string with the name of the column to be used for marker's size.
@@ -1614,7 +1628,7 @@ def scatter(self, x, y, size=None, s=None, color=None, c=None, **kwargs):
1614
1628
1615
1629
.. versionchanged:: 1.1.0
1616
1630
1617
- color : str, int or array-like, optional
1631
+ c : str, int or array-like, optional
1618
1632
The color of each point. Possible values are:
1619
1633
1620
1634
- A single color string referred to by name, RGB or RGBA code,
@@ -1653,7 +1667,7 @@ def scatter(self, x, y, size=None, s=None, color=None, c=None, **kwargs):
1653
1667
... columns=['length', 'width', 'species'])
1654
1668
>>> ax1 = df.plot.scatter(x='length',
1655
1669
... y='width',
1656
- ... color ='DarkBlue')
1670
+ ... c ='DarkBlue')
1657
1671
1658
1672
And now with the color determined by a column as well.
1659
1673
@@ -1662,10 +1676,25 @@ def scatter(self, x, y, size=None, s=None, color=None, c=None, **kwargs):
1662
1676
1663
1677
>>> ax2 = df.plot.scatter(x='length',
1664
1678
... y='width',
1665
- ... color ='species',
1679
+ ... c ='species',
1666
1680
... colormap='viridis')
1667
1681
"""
1668
- return self (kind = "scatter" , x = x , y = y , s = size or s , c = color or c , ** kwargs )
1682
+
1683
+ s = kwargs .pop ('s' , None )
1684
+ size = kwargs .pop ('size' , None )
1685
+ if s is not None and size is not None :
1686
+ raise TypeError ("Specify exactly one of `s` and `size`" )
1687
+ if s is not None or size is not None :
1688
+ kwargs .setdefault ('s' , s or size )
1689
+
1690
+ c = kwargs .pop ('c' , None )
1691
+ color = kwargs .pop ('color' , None )
1692
+ if c is not None and color is not None :
1693
+ raise TypeError ("Specify exactly one of `c` and `color`" )
1694
+ if c is not None or color is not None :
1695
+ kwargs .setdefault ('c' , c or color )
1696
+
1697
+ return self (kind = "scatter" , x = x , y = y , ** kwargs )
1669
1698
1670
1699
def hexbin (self , x , y , C = None , reduce_C_function = None , gridsize = None , ** kwargs ):
1671
1700
"""
0 commit comments