Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Aug 14, 2024
1 parent 0f5e803 commit df98a2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/user-guide/misc/visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ To create a scatter plot we can pass columns of a `DataFrame` directly to Matplo
Matplotlib does not have explicit support for Polars objects but can accept a Polars `Series` by
converting it to a NumPy array (which is zero-copy for numeric data without null values).

Note that because the column `'species'` isn't numeric, we need to first convert it to numeric values so that
it can be passed as an argument to `c`.

{{code_block('user-guide/misc/visualization','matplotlib_show_plot',[])}}

```python exec="on" session="user-guide/misc/visualization"
Expand Down
6 changes: 3 additions & 3 deletions py-polars/polars/dataframe/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def bar(
color
Column to color bars by.
tooltip
Columns to show values of when hovering over points with pointer.
Columns to show values of when hovering over bars with pointer.
*args, **kwargs
Additional arguments and keyword arguments passed to Altair.
Expand All @@ -94,7 +94,7 @@ def bar(
... "stock": ["a", "a", "a", "b", "b", "b"],
... }
... )
>>> df.plot.line(x="date", y="price", color="stock") # doctest: +SKIP
>>> df.plot.bar(x="price", y="count()") # doctest: +SKIP
"""
encodings: Encodings = {}
if x is not None:
Expand Down Expand Up @@ -145,7 +145,7 @@ def line(
order
Column to use for order of data points in lines.
tooltip
Columns to show values of when hovering over points with pointer.
Columns to show values of when hovering over lines with pointer.
*args, **kwargs
Additional arguments and keyword arguments passed to Altair.
Expand Down

0 comments on commit df98a2e

Please sign in to comment.