Cptq
Cptq

Reputation: 113

Plotting many points in Julia

I am working on a project that calls for plotting of (x,y) points in the plane in Julia. So far, using Plots with pyplot backend in a Jupyter notebook, I have been able to plot a few million of points at a time with simple scatter() functions. However, I would like to plot more at a time and I bet that this is not really an efficient method as I scale up n.

Are there are nicer, faster, and/or less memory intensive ways to plot many points in Julia? I would prefer to use something that stays close to my setup above, but that is not necessary. Switching language or switching my method of displaying the data may also be considered.

Upvotes: 1

Views: 1404

Answers (1)

Michael K. Borregaard
Michael K. Borregaard

Reputation: 8044

The GR backend for Plots is faster than pyplot generally. If you experience lags when you increase the number of points, you can display plots faster if you change the output format to png by using the keyword fmt = :png in the plot call. Several million points should really not be a problem. GR is also working on an adaptive shading for very high point densities.

Should you end up hitting the upper limit of what Plots+GR can do, and especially if you have a nice graphics card/chip, you might consider Makie - this blog post is really old and Makie has developed a lot since, but it shows the general idea: https://hackernoon.com/drawing-2-7-billion-points-in-10s-ecc8c85ca8fa

Upvotes: 2

Related Questions