Skip to content

Commit

Permalink
fixing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chelsea-lin committed Mar 14, 2024
1 parent 2b58a94 commit b462808
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 42 deletions.
2 changes: 1 addition & 1 deletion bigframes/operations/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import bigframes.operations._matplotlib as bfplt


class PlotAccessor:
class PlotAccessor(vendordt.PlotAccessor):
__doc__ = vendordt.PlotAccessor.__doc__

def __init__(self, data) -> None:
Expand Down
51 changes: 10 additions & 41 deletions third_party/bigframes_vendored/pandas/plotting/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@


class PlotAccessor:
"""
Make plots of Series or DataFrame with the `matplotlib` backend.
"""
"""Make plots of Series or DataFrame with the `matplotlib` backend."""

def hist(
self, by: typing.Optional[typing.Sequence[str]] = None, bins: int = 10, **kwargs
Expand All @@ -21,9 +19,6 @@ def hist(
**Examples:**
.. plot::
:context: close-figs
>>> import bigframes.pandas as bpd
>>> import numpy as np
>>> df = bpd.DataFrame(np.random.randint(1, 7, 6000), columns=['one'])
Expand Down Expand Up @@ -61,9 +56,6 @@ def line(
**Examples:**
.. plot::
:context: close-figs
>>> import bigframes.pandas as bpd
>>> df = bpd.DataFrame(
... {
Expand Down Expand Up @@ -102,7 +94,6 @@ def line(
Number of random items for plotting.
sampling_random_state (int, default 0):
Seed for random number generator.
**kwargs:
Additional keyword arguments are documented in
:meth:`DataFrame.plot`.
Expand Down Expand Up @@ -132,9 +123,6 @@ def area(
Draw an area plot based on basic business metrics:
.. plot::
:context: close-figs
>>> import bigframes.pandas as bpd
>>> df = bpd.DataFrame(
... {
Expand All @@ -149,23 +137,14 @@ def area(
Area plots are stacked by default. To produce an unstacked plot,
pass ``stacked=False``:
.. plot::
:context: close-figs
>>> ax = df.plot.area(stacked=False)
Draw an area plot for a single column:
.. plot::
:context: close-figs
>>> ax = df.plot.area(y='sales')
Draw with a different `x`:
.. plot::
:context: close-figs
>>> df = bpd.DataFrame({
... 'sales': [3, 2, 3],
... 'visits': [20, 42, 28],
Expand Down Expand Up @@ -215,9 +194,6 @@ def scatter(
Let's see how to draw a scatter plot using coordinates from the values
in a DataFrame's columns.
.. plot::
:context: close-figs
>>> import bigframes.pandas as bpd
>>> df = bpd.DataFrame([[5.1, 3.5, 0], [4.9, 3.0, 0], [7.0, 3.2, 1],
... [6.4, 3.2, 1], [5.9, 3.0, 2]],
Expand All @@ -228,15 +204,11 @@ def scatter(
And now with the color determined by a column as well.
.. plot::
:context: close-figs
>>> ax2 = df.plot.scatter(x='length',
... y='width',
... c='species',
... colormap='viridis')
Args:
x (int or str):
The column name or column position to be used as horizontal
Expand All @@ -248,30 +220,27 @@ def scatter(
The size of each point. Possible values are:
- A string with the name of the column to be used for marker's size.
- A single scalar so all points have the same size.
- A sequence of scalars, which will be used for each point's size
recursively. For instance, when passing [2,14] all points size
will be either 2 or 14, alternatively.
recursively. For instance, when passing [2,14] all points size
will be either 2 or 14, alternatively.
c (str, int or array-like, optional):
The color of each point. Possible values are:
- A single color string referred to by name, RGB or RGBA code,
for instance 'red' or '#a98d19'.
for instance 'red' or '#a98d19'.
- A sequence of color strings referred to by name, RGB or RGBA
code, which will be used for each point's color recursively. For
instance ['green','yellow'] all points will be filled in green or
yellow, alternatively.
code, which will be used for each point's color recursively. For
instance ['green','yellow'] all points will be filled in green or
yellow, alternatively.
- A column name or position whose values will be used to color the
marker points according to a colormap.
marker points according to a colormap.
sampling_n (int, default 100):
Number of random items for plotting.
sampling_random_state (int, default 0):
Seed for random number generator.
**kwargs:
Additional keyword arguments are documented in
:meth:`DataFrame.plot`.
Expand Down

0 comments on commit b462808

Please sign in to comment.