简体   繁体   中英

How can I smooth a set of 3D points?

this question is an extension of my previous question that you can find here:

How to plot a data cube in python

The thing is that I have a 3D plot of point but if I follow the method of my previous question I could get an overflow error when I have too many points to plot. I have to plot millions of points so I need to smooth the 3D distribution, otherwise it takes a huge amount of time to make the plot and I could also get memory errors.

I was thinking that maybe I can convolve the distribution with a Gaussian kernel, but I don't know if it's the best option. Moreover, I am not able to do it yet.

As I answered in original question, the Dots plot is good for you. It is produced by MathGL -- GPL plotting library. Add it don't need many memory if you save in bitmap format (PNG, JPEG, GIF and so on).

However, there are another option for smoothing itself: (i) make histogram of point distribution (ie average points values or colors inside some cell) -- in frame MathGL you can use Hist() function even for points in 3D space; or (ii) using standard smoothing functions (like mglData::Smooth() in MathGL), but here you need to use regular arrays, ie as {x[i,j,k], y[i,j,k], z[i,j,k], c[i,j,k]}.

Both variant will give you regular arrays which can be plotted by a set of different ways -- see these samples .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM