Repository: holoviz/hvplot

Issue:
y=None doesn't work for Polars dataframes
#### ALL software version info
```
>>> import hvplot
>>> hvplot.__version__
'0.9.1'
>>> import holoviews
>>> holoviews.__version__
'1.18.1'
>>> import polars
>>> polars.__version__
'0.20.3'
```

#### Description of expected behavior and the observed behavior

If you call, say `df.plot.line(x="foo")`, the docs say that all other numeric cols should be used as y values, but instead we get no plot and the following message: `matplotlib backend could not plot any Elements in the Overlay.`

#### Complete, minimal, self-contained example code that reproduces the issue

```python
import polars as pl
pl.DataFrame({"a": [1, 2], "b": [3, 4]}).plot.line(x="a")
```

In the [_get_converter](https://github.com/holoviz/hvplot/blob/734c0cc922152ea6a0f3332bc2bf19f5430d7629/hvplot/plotting/core.py#L1867) method of hvPlotTabularPolars, we see that (if hover_cols is not set to "all") only columns from `x`, `y` and `kwds` will be selected:
```python
                possible_columns = [
                    [v] if isinstance(v, str) else v
                    for v in params.values()
                    if isinstance(v, (str, list))
                ]
                columns = (
                    set(self._data.columns) & set(itertools.chain(*possible_columns))
                ) or {self._data.columns[0]}
                xs = x if is_list_like(x) else (x,)
                ys = y if is_list_like(y) else (y,)
                columns |= {*xs, *ys}
                columns.discard(None)
```

### Proposed solution

When the y value is not specified, select all numeric columns (plus whatever is specified) in _get_converter. We can do this in Polars like this:

```python
import polars as pl
pl.DataFrame({"a": [1, 2], "b": [3, 4], "c": ["foo", "bar"], "d": ["ping", "pong"]}).select([pl.col("d"), pl.col(pl.NUMERIC_DTYPES)])
```
This code will select columns d, a and b.

There is still some filtering based on pandas dtype later in the code but I think this is applied to non-Polars sources too, so we may as well just leave it as it is for now.



- [x] I may be interested in making a pull request to address this



Discussion:

Resolving patch:
diff --git a/hvplot/plotting/core.py b/hvplot/plotting/core.py
--- a/hvplot/plotting/core.py
+++ b/hvplot/plotting/core.py
@@ -1882,13 +1882,21 @@ def _get_converter(self, x=None, y=None, kind=None, **kwds):
                     for v in params.values()
                     if isinstance(v, (str, list))
                 ]
+
                 columns = (
                     set(self._data.columns) & set(itertools.chain(*possible_columns))
                 ) or {self._data.columns[0]}
+                if y is None:
+                    # When y is not specified HoloViewsConverter finds all the numeric
+                    # columns and use them as y values (see _process_chart_y). We meed
+                    # to include these columns too.
+                    columns |= set(self._data.select(pl.col(pl.NUMERIC_DTYPES)).columns)
                 xs = x if is_list_like(x) else (x,)
                 ys = y if is_list_like(y) else (y,)
                 columns |= {*xs, *ys}
                 columns.discard(None)
+                # Reorder the columns as in the data.
+                columns = sorted(columns, key=lambda c: self._data.columns.index(c))
 
         if isinstance(self._data, pl.DataFrame):
             data = self._data.select(columns).to_pandas()


Test patch:
diff --git a/hvplot/tests/testplotting.py b/hvplot/tests/testplotting.py
--- a/hvplot/tests/testplotting.py
+++ b/hvplot/tests/testplotting.py
@@ -67,4 +67,5 @@ def test_plot_supports_polars():
     pl = pytest.importorskip("polars")
     dfp = pl.DataFrame(pd._testing.makeDataFrame())
     out = plot(dfp, 'line')
-    assert isinstance(out, hv.Curve)
+    assert isinstance(out, hv.NdOverlay)
+    assert out.keys() == dfp.columns