Is it possible to colour a scatter3 according to its mean and maximum value

1 Ansicht (letzte 30 Tage)
i have velocities distributed in a 3d scatter plot along a cosine hill prrofile . i want to view where the velocity is increasing and where it is decresing its value.

Antworten (1)

Dave B
Dave B am 27 Sep. 2021
You can color the points in a scatter3 by passing in a vector specifying the value you'd like to map onto color as the 5th argument to scatter3
[xi,yi]=meshgrid(1:30,1:30);
zi=gausswin(30)*gausswin(30)';
[fx,fy]=gradient(zi);
nexttile
ci=zi;
scatter3(xi(:),yi(:),zi(:),10,ci(:),'filled')
colorbar
nexttile
ci=fx;
scatter3(xi(:),yi(:),zi(:),10,ci(:),'filled')
colorbar
nexttile
ci=fy;
scatter3(xi(:),yi(:),zi(:),10,ci(:),'filled')
colorbar
nexttile
ci=sqrt(fx.^2+fy.^2);
scatter3(xi(:),yi(:),zi(:),10,ci(:),'filled')
colorbar
colormap turbo

Kategorien

Mehr zu Colormaps finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by