# Am I supposed to use \`hvplot\` only in a jupyter notebook? Where's the basic documentation?

**URL:** <https://discourse.holoviz.org/t/am-i-supposed-to-use-hvplot-only-in-a-jupyter-notebook-wheres-the-basic-documentation/7558>\
**Category:** hvPlot\
**Created:** [August 8, 2024, 11:44pm UTC](https://discourse.holoviz.org/t/am-i-supposed-to-use-hvplot-only-in-a-jupyter-notebook-wheres-the-basic-documentation/7558 "2024-08-08T23:44:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![liufeimath](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/liufeimath/32/6828_2.png) [@liufeimath](https://discourse.holoviz.org/u/liufeimath)\
**Post date:** [August 8, 2024, 11:44pm UTC](https://discourse.holoviz.org/t/am-i-supposed-to-use-hvplot-only-in-a-jupyter-notebook-wheres-the-basic-documentation/7558/1 "2024-08-08T23:44:11Z")

</div>

Recently I moved from pandas to polars and it uses hvplot as the visualization tool. The figures are quite fancy (much better than matplotlib) but it appears that some very basic documentation is missing: it didn’t mention anything about the **most basic environment** to run these stuff. Let’s start with the “[Getting Started](https://hvplot.holoviz.org/getting_started/installation.html)” section. Following this I was supposing I should just be able to run the code examples freely after `pip install hvplot`, but it is apparently not the case. My run in an `ipython` interative shell didn’t plot anything. E.g. these code snippets (from the step-by-step guide [here](https://hvplot.holoviz.org/getting_started/hvplot.html)):

```python
import numpy as np
import pandas as pd
np.random.seed(1)

idx = pd.date_range('1/1/2000', periods=1000)
df = pd.DataFrame(np.random.randn(1000, 4), index=idx, columns=list('ABCD')).cumsum()
df.head(2)

import hvplot.pandas # noqa

first_plot = df.hvplot()
first_plot

```

only gives me a short poor text output in the ipython console:

```auto
Out[8]: 
:NdOverlay [Variable]
   :Curve [index] (value)

```

Another run in a jupyter notebook created in vscode worked fine (it gives the fancy interactive stuff that I can zoom in and out).

Now my question is: shall we add at least the very basic documentation about how to use the tool? The hvplot official webpage just gives some succinct instruction notes and some short code snippets. A normal user can very likely reads them as “once I install it, I can just run anywhere with a python interpreter”, but that seems not the case at all. If we require it to run in certain places, e.g. a notebook, should we mention it very explicitly? Or am I missing something?

---

<div class="post-metadata">

**Author:** ![pmav99](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/pmav99/32/2737_2.png) [@pmav99](https://discourse.holoviz.org/u/pmav99)\
**Post date:** [August 9, 2024, 11:40am UTC](https://discourse.holoviz.org/t/am-i-supposed-to-use-hvplot-only-in-a-jupyter-notebook-wheres-the-basic-documentation/7558/2 "2024-08-09T11:40:48Z")

</div>

Yeah the docs are lacking.

Just for the record, on ipython you need something like this:

```python
import panel as pn

def show(obj):
    pn.serve(obj, threaded=True)

show(first_plot)

```

which will spin up a `panel` server (essentially a `bokeh` server) running on a random port on localhost.

You can close the running servers (in order to e.g. conserve RAM) with:

```auto
pn.state.kill_all_servers()

```

---

<div class="post-metadata">

**Author:** ![Marc](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/marc/32/24_2.png) [@Marc](https://discourse.holoviz.org/u/Marc)\
**Post date:** [August 9, 2024, 5:45pm UTC](https://discourse.holoviz.org/t/am-i-supposed-to-use-hvplot-only-in-a-jupyter-notebook-wheres-the-basic-documentation/7558/3 "2024-08-09T17:45:20Z")

</div>

The `hvplot` docs can be improved. But they probably need the input from somebody like you to really improve.

If you are interested try making a github issue describing the things you would like to change. Then make a PR with the proposed changes or ask for help in the issue how to contribute those changes.

Small changes like a few lines in a document is a great first contribution and would be highly appreciated.

[Issues · holoviz/hvplot (github.com)](https://github.com/holoviz/hvplot/issues)

---

<div class="post-metadata">

**Author:** ![liufeimath](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/liufeimath/32/6828_2.png) [@liufeimath](https://discourse.holoviz.org/u/liufeimath)\
**Post date:** [August 13, 2024, 10:30pm UTC](https://discourse.holoviz.org/t/am-i-supposed-to-use-hvplot-only-in-a-jupyter-notebook-wheres-the-basic-documentation/7558/4 "2024-08-13T22:30:35Z")

</div>

Thanks for the suggestions. I added a [new issue](https://github.com/holoviz/hvplot/issues/1393) and created a PR for this in the hvplot github repo.

---

<div class="post-metadata">

**Author:** ![liufeimath](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/liufeimath/32/6828_2.png) [@liufeimath](https://discourse.holoviz.org/u/liufeimath)\
**Post date:** [August 16, 2024, 1:07am UTC](https://discourse.holoviz.org/t/am-i-supposed-to-use-hvplot-only-in-a-jupyter-notebook-wheres-the-basic-documentation/7558/5 "2024-08-16T01:07:34Z")

</div>

fyi I learned from the hvplot repo contributor ([reference](https://github.com/holoviz/hvplot/pull/1392/files/20b829a914104669c264c42c1cc798db30a55da2#r1718842728)) that one can just use [`hvplot.show`](https://hvplot.holoviz.org/user_guide/Viewing.html#python-command-prompt-scripts) in a raw python shell to display the plot. Example:

```python
import pandas as pd
import numpy as np
import hvplot
import hvplot.pandas

df = pd.DataFrame(np.random.rand(10, 2))

hvplot.show(df.hvplot())

```

This seems easier than the `import panel` approach.

---

<div class="post-metadata">

**Author:** ![pmav99](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/pmav99/32/2737_2.png) [@pmav99](https://discourse.holoviz.org/u/pmav99)\
**Post date:** [August 16, 2024, 6:17am UTC](https://discourse.holoviz.org/t/am-i-supposed-to-use-hvplot-only-in-a-jupyter-notebook-wheres-the-basic-documentation/7558/6 "2024-08-16T06:17:47Z")

</div>

Cool thanks! I was not aware of `hvplot.show()`

Nevertheless, `hvplot.show()` defaults to `threaded=False` which means that most of the time I would still want to define a wrapper.

---

<div class="post-metadata">

**Author:** ![liufeimath](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/liufeimath/32/6828_2.png) [@liufeimath](https://discourse.holoviz.org/u/liufeimath)\
**Post date:** [August 16, 2024, 8:59am UTC](https://discourse.holoviz.org/t/am-i-supposed-to-use-hvplot-only-in-a-jupyter-notebook-wheres-the-basic-documentation/7558/7 "2024-08-16T08:59:09Z")

</div>

Update: this is resolved by [this PR](https://github.com/holoviz/hvplot/pull/1392).
