Here we show that it is possible to represent millions of points with WebGL. For larger datasets, or for a clearer visualization of the density of points, it is also possible to use datashader.
Compare WebGL and SVG¶
Checkout this notebook to compare WebGL and SVG scatter plots with 75,000 random data points
WebGL with Plotly Express¶
rendermode argument to supported Plotly Express functions can be used to enable WebGL rendering.
Here is an example that creates a 100,000 point scatter plot using Plotly Express with WebGL rendering enabled.
import plotly.express as px import pandas as pd import numpy as np np.random.seed(1) N = 100000 df = pd.DataFrame(dict(x=np.random.randn(N), y=np.random.randn(N))) fig = px.scatter(df, x="x", y="y", render_mode='webgl') fig.update_traces(marker_line=dict(width=1, color='DarkSlateGray')) fig.show()