Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(python): Update plot docs to refer to docstrings #17504

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 2 additions & 39 deletions py-polars/docs/source/reference/dataframe/plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,6 @@
Plot
====

Polars does not implement plotting logic itself, but instead defers to
hvplot. Please see the `hvplot reference gallery <https://hvplot.holoviz.org/reference/index.html>`_
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
26 changes: 2 additions & 24 deletions py-polars/docs/source/reference/series/plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,6 @@
Plot
====

Polars does not implement plotting logic itself, but instead defers to
hvplot. Please see the `hvplot reference gallery <https://hvplot.holoviz.org/reference/index.html>`_
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