matplotlib scatter with 2 million points takes forever
matplotlib 3.8.2 on a Jupyter server, trying to plot a scatter of 2 million (x,y) points from a pandas DataFrame. plt.scatter() takes about 40 seconds and the resulting PNG is 50MB. I'm on a laptop with 16GB RAM. I've heard of datashader but never used it. Is there a way to just make scatter faster without adding a whole new library? I tried setting rasterized=True which helped the file size but not the render time. Should I be downsampling first? What do people do for this in practice?
4 replies