From af051a13c3e578c98be4e3af23084c1f16b8049e Mon Sep 17 00:00:00 2001 From: Henry Harbeck Date: Tue, 9 Jul 2024 02:33:41 +1000 Subject: [PATCH] update `plot` docs to refer to docstrings --- .../docs/source/reference/dataframe/plot.rst | 41 +------------------ .../docs/source/reference/series/plot.rst | 26 +----------- 2 files changed, 4 insertions(+), 63 deletions(-) diff --git a/py-polars/docs/source/reference/dataframe/plot.rst b/py-polars/docs/source/reference/dataframe/plot.rst index c43b717971bf..85f1cc9395a8 100644 --- a/py-polars/docs/source/reference/dataframe/plot.rst +++ b/py-polars/docs/source/reference/dataframe/plot.rst @@ -2,43 +2,6 @@ Plot ==== -Polars does not implement plotting logic itself, but instead defers to -hvplot. Please see the `hvplot reference gallery `_ -for more information and documentation. - -Examples --------- -Scatter plot: - -.. code-block:: python - - df = pl.DataFrame( - { - "length": [1, 4, 6], - "width": [4, 5, 6], - "species": ["setosa", "setosa", "versicolor"], - } - ) - df.plot.scatter(x="length", y="width", by="species") - -Line plot: - -.. code-block:: python - - from datetime import date - df = pl.DataFrame( - { - "date": [date(2020, 1, 2), date(2020, 1, 3), date(2020, 1, 3)], - "stock_1": [1, 4, 6], - "stock_2": [1, 5, 2], - } - ) - df.plot.line(x="date", y=["stock_1", "stock_2"]) - -For more info on what you can pass, you can use ``hvplot.help``: - -.. code-block:: python - - import hvplot - hvplot.help('scatter') +.. currentmodule:: polars +.. autoproperty:: DataFrame.plot \ No newline at end of file diff --git a/py-polars/docs/source/reference/series/plot.rst b/py-polars/docs/source/reference/series/plot.rst index b6e01f685e80..f7f719b8472e 100644 --- a/py-polars/docs/source/reference/series/plot.rst +++ b/py-polars/docs/source/reference/series/plot.rst @@ -2,28 +2,6 @@ Plot ==== -Polars does not implement plotting logic itself, but instead defers to -hvplot. Please see the `hvplot reference gallery `_ -for more information and documentation. +.. currentmodule:: polars -Examples --------- -Histogram: - -.. code-block:: python - - s = pl.Series([1, 4, 2]) - s.plot.hist() - -KDE plot (note: in addition to ``hvplot``, this one also requires ``scipy``): - -.. code-block:: python - - s.plot.kde() - -For more info on what you can pass, you can use ``hvplot.help``: - -.. code-block:: python - - import hvplot - hvplot.help("hist") +.. autoproperty:: Series.plot \ No newline at end of file