How can you decimate data depending on zoom level of plot?

152 Views Asked by At

The documentation for holoviews' decimate operation seems to imply that if max_samples=100, say, you get a plot with 100 points at most no matter the zoom level.

With the following example, I see no new dots appear as I zoom in... can holoviews achieve this? can some other package?

import numpy as np
import holoviews as hv
import pandas as pd
import numpy as np

# from holoviews import opts
# from holoviews.operation.datashader import datashade, shade, dynspread, spread
# from holoviews.operation.datashader import rasterize, ResamplingOperation
from holoviews.operation import decimate

hv.extension('bokeh', width=200)

# Default values suitable for this notebook
decimate.max_samples=100

np.random.seed(1)
points = hv.Points(np.random.multivariate_normal((0,0), [[0.1, 0.1], [0.1, 1.0]], (1_000_000,)))

decimate(points)

The above code seems to decimate data once, and then show the same dots regardless of x_range and y_range...

Any ideas?

Thanks!

0

There are 0 best solutions below