Skip to content Skip to sidebar Skip to footer

Speeding Up Matplotlib Scatter Plots

I'm trying to make an interactive program which primarily uses matplotlib to make scatter plots of rather a lot of points (10k-100k or so). Right now it works, but changes take to

Solution 1:

I've been through this a few times trying to speed up scatter plots with large numbers of points, variously trying:

  • Different marker types
  • Limiting colours
  • Cutting down the dataset
  • Using a heatmap / grid instead of a scatter plot

And none of these things worked. Matplotlib is just not very performant when it comes to scatter plots. My only recommendation is to use a different plotting library, though I haven't personally found one that was suitable. I know this doesn't help much, but it may save you some hours of fruitless tinkering.

Solution 2:

We are actively working on performance for large matplotlib scatter plots. I'd encourage you to get involved in the conversation (http://matplotlib.1069221.n5.nabble.com/mpl-1-2-1-Speedup-code-by-removing-startswith-calls-and-some-for-loops-td41767.html) and, even better, test out the pull request that has been submitted to make life much better for a similar case (https://github.com/matplotlib/matplotlib/pull/2156).

HTH

Post a Comment for "Speeding Up Matplotlib Scatter Plots"