@@ -215,6 +215,66 @@ def area(
215
215
"""
216
216
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
217
217
218
+ def bar (
219
+ self ,
220
+ x : typing .Optional [typing .Hashable ] = None ,
221
+ y : typing .Optional [typing .Hashable ] = None ,
222
+ ** kwargs ,
223
+ ):
224
+ """
225
+ Draw a vertical bar plot.
226
+
227
+ This function calls `pandas.plot` to generate a plot with a random sample
228
+ of items. For consistent results, the random sampling is reproducible.
229
+ Use the `sampling_random_state` parameter to modify the sampling seed.
230
+
231
+ **Examples:**
232
+
233
+ Basic plot.
234
+
235
+ >>> import bigframes.pandas as bpd
236
+ >>> bpd.options.display.progress_bar = None
237
+ >>> df = bpd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]})
238
+ >>> ax = df.plot.bar(x='lab', y='val', rot=0)
239
+
240
+ Plot a whole dataframe to a bar plot. Each column is assigned a distinct color,
241
+ and each row is nested in a group along the horizontal axis.
242
+
243
+ >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
244
+ >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
245
+ >>> index = ['snail', 'pig', 'elephant',
246
+ ... 'rabbit', 'giraffe', 'coyote', 'horse']
247
+ >>> df = bpd.DataFrame({'speed': speed, 'lifespan': lifespan}, index=index)
248
+ >>> ax = df.plot.bar(rot=0)
249
+
250
+ Plot stacked bar charts for the DataFrame.
251
+
252
+ >>> ax = df.plot.bar(stacked=True)
253
+
254
+ If you don’t like the default colours, you can specify how you’d like each column
255
+ to be colored.
256
+
257
+ >>> axes = df.plot.bar(
258
+ ... rot=0, subplots=True, color={"speed": "red", "lifespan": "green"}
259
+ ... )
260
+
261
+ Args:
262
+ x (label or position, optional):
263
+ Allows plotting of one column versus another. If not specified, the index
264
+ of the DataFrame is used.
265
+ y (label or position, optional):
266
+ Allows plotting of one column versus another. If not specified, all numerical
267
+ columns are used.
268
+ **kwargs:
269
+ Additional keyword arguments are documented in
270
+ :meth:`DataFrame.plot`.
271
+
272
+ Returns:
273
+ matplotlib.axes.Axes or numpy.ndarray:
274
+ Area plot, or array of area plots if subplots is True.
275
+ """
276
+ raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
277
+
218
278
def scatter (
219
279
self ,
220
280
x : typing .Optional [typing .Hashable ] = None ,
0 commit comments