Search code examples
pythonplotholoviewshvplot

Managing large number of data in holoviews/hvplot curve and scatter plots


Let's say I have a large DataFrame with lots of rows and I want to do a simple line plot of the data using hvplot/holoviews.

Example:

pd.DataFrame([i for i in range(1000000)]).hvplot()

On my machine this plot is slow to be rendered and very slow to navigate in with pan, zoom and so on. Is there an option to make the plot lighter to handle, kind of what datashade option does for multidimensional plotting?

At the moment, on my real data sampling is not an option, I want to keep all of my original data.


Solution

  • Datashader is not limited to multidimensional data, so just add datashade=True or rasterize=True (which is preferred in most cases, since it lets Bokeh provide colorbars and hover information).

    screenshot