@@ -1089,14 +1089,20 @@ def __call__(self, *args, **kwargs):
1089
1089
@Substitution (kind = "line" )
1090
1090
@Appender (_bar_or_line_doc )
1091
1091
def line (
1092
- self , x : Hashable | None = None , y : Hashable | None = None , ** kwargs
1092
+ self ,
1093
+ x : Hashable | None = None ,
1094
+ y : Hashable | None = None ,
1095
+ color : str | Sequence [str ] | dict | None = None ,
1096
+ ** kwargs ,
1093
1097
) -> PlotAccessor :
1094
1098
"""
1095
1099
Plot Series or DataFrame as lines.
1096
1100
1097
1101
This function is useful to plot lines using DataFrame's values
1098
1102
as coordinates.
1099
1103
"""
1104
+ if color is not None :
1105
+ kwargs ["color" ] = color
1100
1106
return self (kind = "line" , x = x , y = y , ** kwargs )
1101
1107
1102
1108
@Appender (
@@ -1178,7 +1184,11 @@ def line(
1178
1184
@Substitution (kind = "bar" )
1179
1185
@Appender (_bar_or_line_doc )
1180
1186
def bar ( # pylint: disable=disallowed-name
1181
- self , x : Hashable | None = None , y : Hashable | None = None , ** kwargs
1187
+ self ,
1188
+ x : Hashable | None = None ,
1189
+ y : Hashable | None = None ,
1190
+ color : str | Sequence [str ] | dict | None = None ,
1191
+ ** kwargs ,
1182
1192
) -> PlotAccessor :
1183
1193
"""
1184
1194
Vertical bar plot.
@@ -1189,6 +1199,8 @@ def bar( # pylint: disable=disallowed-name
1189
1199
axis of the plot shows the specific categories being compared, and the
1190
1200
other axis represents a measured value.
1191
1201
"""
1202
+ if color is not None :
1203
+ kwargs ["color" ] = color
1192
1204
return self (kind = "bar" , x = x , y = y , ** kwargs )
1193
1205
1194
1206
@Appender (
@@ -1266,7 +1278,11 @@ def bar( # pylint: disable=disallowed-name
1266
1278
@Substitution (kind = "bar" )
1267
1279
@Appender (_bar_or_line_doc )
1268
1280
def barh (
1269
- self , x : Hashable | None = None , y : Hashable | None = None , ** kwargs
1281
+ self ,
1282
+ x : Hashable | None = None ,
1283
+ y : Hashable | None = None ,
1284
+ color : str | Sequence [str ] | dict | None = None ,
1285
+ ** kwargs ,
1270
1286
) -> PlotAccessor :
1271
1287
"""
1272
1288
Make a horizontal bar plot.
@@ -1277,6 +1293,8 @@ def barh(
1277
1293
axis of the plot shows the specific categories being compared, and the
1278
1294
other axis represents a measured value.
1279
1295
"""
1296
+ if color is not None :
1297
+ kwargs ["color" ] = color
1280
1298
return self (kind = "barh" , x = x , y = y , ** kwargs )
1281
1299
1282
1300
def box (self , by : IndexLabel | None = None , ** kwargs ) -> PlotAccessor :
@@ -1602,7 +1620,7 @@ def area(
1602
1620
"""
1603
1621
return self (kind = "area" , x = x , y = y , stacked = stacked , ** kwargs )
1604
1622
1605
- def pie (self , ** kwargs ) -> PlotAccessor :
1623
+ def pie (self , y : IndexLabel | None = None , ** kwargs ) -> PlotAccessor :
1606
1624
"""
1607
1625
Generate a pie plot.
1608
1626
@@ -1649,6 +1667,8 @@ def pie(self, **kwargs) -> PlotAccessor:
1649
1667
1650
1668
>>> plot = df.plot.pie(subplots=True, figsize=(11, 6))
1651
1669
"""
1670
+ if y is not None :
1671
+ kwargs ["y" ] = y
1652
1672
if (
1653
1673
isinstance (self ._parent , ABCDataFrame )
1654
1674
and kwargs .get ("y" , None ) is None
0 commit comments