@@ -275,6 +275,109 @@ def bar(
275275 """
276276 raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
277277
278+ def barh (
279+ self ,
280+ x : typing .Optional [typing .Hashable ] = None ,
281+ y : typing .Optional [typing .Hashable ] = None ,
282+ ** kwargs ,
283+ ):
284+ """
285+ Draw a horizontal bar plot.
286+
287+ This function calls `pandas.plot` to generate a plot with a random sample
288+ of items. For consistent results, the random sampling is reproducible.
289+ Use the `sampling_random_state` parameter to modify the sampling seed.
290+
291+ **Examples:**
292+
293+ Basic plot.
294+
295+ >>> import bigframes.pandas as bpd
296+ >>> bpd.options.display.progress_bar = None
297+ >>> df = bpd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]})
298+ >>> ax = df.plot.barh(x='lab', y='val', rot=0)
299+
300+ Plot a whole dataframe to a barh plot. Each column is assigned a distinct color,
301+ and each row is nested in a group along the horizontal axis.
302+
303+ >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
304+ >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
305+ >>> index = ['snail', 'pig', 'elephant',
306+ ... 'rabbit', 'giraffe', 'coyote', 'horse']
307+ >>> df = bpd.DataFrame({'speed': speed, 'lifespan': lifespan}, index=index)
308+ >>> ax = df.plot.barh(rot=0)
309+
310+ Plot stacked barh charts for the DataFrame.
311+
312+ >>> ax = df.plot.barh(stacked=True)
313+
314+ If you don’t like the default colours, you can specify how you’d like each column
315+ to be colored.
316+
317+ >>> axes = df.plot.barh(
318+ ... rot=0, subplots=True, color={"speed": "red", "lifespan": "green"}
319+ ... )
320+
321+ Args:
322+ x (label or position, optional):
323+ Allows plotting of one column versus another. If not specified, the index
324+ of the DataFrame is used.
325+ y (label or position, optional):
326+ Allows plotting of one column versus another. If not specified, all numerical
327+ columns are used.
328+ **kwargs:
329+ Additional keyword arguments are documented in
330+ :meth:`DataFrame.plot`.
331+
332+ Returns:
333+ matplotlib.axes.Axes or numpy.ndarray:
334+ Area plot, or array of area plots if subplots is True.
335+ """
336+ raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
337+
338+ def pie (
339+ self ,
340+ y : typing .Optional [typing .Hashable ] = None ,
341+ ** kwargs ,
342+ ):
343+ """
344+ Generate a pie plot.
345+
346+ A pie plot is a proportional representation of the numerical data in a
347+ column. This function wraps :meth:`matplotlib.pyplot.pie` for the
348+ specified column. If no column reference is passed and
349+ ``subplots=True`` a pie plot is drawn for each numerical column
350+ independently.
351+
352+ **Examples:**
353+
354+ In the example below we have a DataFrame with the information about
355+ planet's mass and radius. We pass the 'mass' column to the
356+ pie function to get a pie plot.
357+
358+ >>> import bigframes.pandas as bpd
359+ >>> bpd.options.display.progress_bar = None
360+
361+ >>> df = bpd.DataFrame({'mass': [0.330, 4.87 , 5.97],
362+ ... 'radius': [2439.7, 6051.8, 6378.1]},
363+ ... index=['Mercury', 'Venus', 'Earth'])
364+ >>> plot = df.plot.pie(y='mass', figsize=(5, 5))
365+
366+ >>> plot = df.plot.pie(subplots=True, figsize=(11, 6))
367+
368+ Args:
369+ y (int or label, optional):
370+ Label or position of the column to plot.
371+ If not provided, ``subplots=True`` argument must be passed.
372+ **kwargs:
373+ Keyword arguments to pass on to :meth:`DataFrame.plot`.
374+
375+ Returns:
376+ matplotlib.axes.Axes or np.ndarray:
377+ A NumPy array is returned when `subplots` is True.
378+ """
379+ raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
380+
278381 def scatter (
279382 self ,
280383 x : typing .Optional [typing .Hashable ] = None ,
0 commit comments