# Missing datapoints when using hvplot,line

**URL:** <https://discourse.holoviz.org/t/missing-datapoints-when-using-hvplot-line/6729>\
**Category:** HoloViews\
**Created:** [January 16, 2024, 8:08am UTC](https://discourse.holoviz.org/t/missing-datapoints-when-using-hvplot-line/6729 "2024-01-16T08:08:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![epifanio](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/epifanio/32/855_2.png) [@epifanio](https://discourse.holoviz.org/u/epifanio)\
**Post date:** [January 16, 2024, 8:08am UTC](https://discourse.holoviz.org/t/missing-datapoints-when-using-hvplot-line/6729/1 "2024-01-16T08:08:37Z")

</div>

I am rendering a time series using hvplot.line. When zooming in on the plot, I noticed some of the lines were disappearing where there should be data points. The lines are disappearing as the zoom increases. How can I control or avoid that?

This behavior is more clear when overlaying line- and scatter-plots of the same dataset.  
The following code should reproduce the issue:

```python
import xarray as xr
import holoviews as hv
import hvplot.xarray

url = "https://thredds.met.no/thredds/dodsC/alertness/YOPP_supersite/obs/utqiagvik/utqiagvik_obs_timeSeries_20180701_20180930.nc"
ds = xr.open_dataset(url)

# the following line plot which has data disappearing as we zoom in
ds['snd'].hvplot.line(x='time01')

# overlay showing missing data points in the line plot:
hv.Overlay([ds['snd'].hvplot.line(x='time01'), 
            ds['snd'].hvplot.scatter(x='time01')]).opts(show_grid=True)

```

---

<div class="post-metadata">

**Author:** ![Hoxbro](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/hoxbro/32/3590_2.png) [@Hoxbro](https://discourse.holoviz.org/u/Hoxbro)\
**Post date:** [January 16, 2024, 9:15am UTC](https://discourse.holoviz.org/t/missing-datapoints-when-using-hvplot-line/6729/2 "2024-01-16T09:15:26Z")

</div>

I have a hard time recreating this is it possible to make a screen recording?

---

<div class="post-metadata">

**Author:** ![epifanio](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/epifanio/32/855_2.png) [@epifanio](https://discourse.holoviz.org/u/epifanio)\
**Post date:** [January 16, 2024, 10:08am UTC](https://discourse.holoviz.org/t/missing-datapoints-when-using-hvplot-line/6729/3 "2024-01-16T10:08:39Z")

</div>

I tried to record an example here: [No title available. Video i...](https://share.zight.com/lluOzPlO)

It seems the issue is related to the Y limit on the plot - when I fine tune the Y zoom to let the data “fit” in the plot canvas, then all the points are connected and the line plot is representative of the dataset - otherwise, the line plot is removing lines where actual data exist.

---

<div class="post-metadata">

**Author:** ![Hoxbro](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/hoxbro/32/3590_2.png) [@Hoxbro](https://discourse.holoviz.org/u/Hoxbro)\
**Post date:** [January 16, 2024, 10:33am UTC](https://discourse.holoviz.org/t/missing-datapoints-when-using-hvplot-line/6729/4 "2024-01-16T10:33:35Z")

</div>

By looking at it, this is because it is only a single value surrounded by nan values. A line needs two points to be shown.

Can you check the data if this is the case?

---

<div class="post-metadata">

**Author:** ![epifanio](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/epifanio/32/855_2.png) [@epifanio](https://discourse.holoviz.org/u/epifanio)\
**Post date:** [January 16, 2024, 10:47am UTC](https://discourse.holoviz.org/t/missing-datapoints-when-using-hvplot-line/6729/5 "2024-01-16T10:47:55Z")

</div>

Yes, that is exactly it! Thank you so much for clarifying the behavior. It is intuitive and visible when there is a large gap [large data - gap](https://share.zight.com/Z4u2ZQ5P) in the data, but It is somehow confusing to see lines disappearing when zooming in. If I understood, this means that the line is shown because there is a sort of downsampling when zoomed out? why if I “adjust” the y-lim in the plot the NaN is ignored and a line is plotted?

---

<div class="post-metadata">

**Author:** ![Hoxbro](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/hoxbro/32/3590_2.png) [@Hoxbro](https://discourse.holoviz.org/u/Hoxbro)\
**Post date:** [January 16, 2024, 11:01am UTC](https://discourse.holoviz.org/t/missing-datapoints-when-using-hvplot-line/6729/6 "2024-01-16T11:01:30Z")

</div>

There is no downsampling happening; what is happening at the end of your video should not happen.

What versions of Bokeh and HoloViews are you using? Can you try `hv.renderer('bokeh').webgl = False` and see if this changes the behavior?

---

<div class="post-metadata">

**Author:** ![epifanio](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/epifanio/32/855_2.png) [@epifanio](https://discourse.holoviz.org/u/epifanio)\
**Post date:** [January 16, 2024, 11:06am UTC](https://discourse.holoviz.org/t/missing-datapoints-when-using-hvplot-line/6729/7 "2024-01-16T11:06:59Z")

</div>

Using `hv.renderer('bokeh').webgl = False` - I no longer see lines disappearing!

---

<div class="post-metadata">

**Author:** ![Hoxbro](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/hoxbro/32/3590_2.png) [@Hoxbro](https://discourse.holoviz.org/u/Hoxbro)\
**Post date:** [January 16, 2024, 11:11am UTC](https://discourse.holoviz.org/t/missing-datapoints-when-using-hvplot-line/6729/8 "2024-01-16T11:11:25Z")

</div>

I think this should be fixed on the latest version of Bokeh.

---

<div class="post-metadata">

**Author:** ![epifanio](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/epifanio/32/855_2.png) [@epifanio](https://discourse.holoviz.org/u/epifanio)\
**Post date:** [January 16, 2024, 11:14am UTC](https://discourse.holoviz.org/t/missing-datapoints-when-using-hvplot-line/6729/9 "2024-01-16T11:14:26Z")

</div>

Wonderful! Thank you so much for your help.  
I am running:

```python
Python 3.11.6 | packaged by conda-forge | (main, Oct 3 2023, 10:40:35) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bokeh
>>> bokeh. __version__'3.3.3'

```

I will try to install the `3.4.0.dev5` version and see if that fixes it.
