MATLAB Answers

0

3D scatter plot scroll through Z axis

Asked by Chiara Pivetta on 31 Oct 2018
Latest activity Commented on by KSSV
on 31 Oct 2018
Hi,
I am new in matlab. I have a 3D scatter plot and I would like to interactively choose to display only one Z position at the time or a selection of Z positions.
Anyone has an idea how to do it?
Thanks a lot!

  0 Comments

Sign in to comment.

1 Answer

Answer by KSSV
on 31 Oct 2018

N = 100 ;
x = rand(N,1) ;
y = rand(N,1) ;
z = rand(N,1) ;
figure
scatter(x,y,10,z,'filled')
title('all points')
figure
scatter(x(N),y(N),10,z(N),'filled')
title('last point')
figure
idx = z<=0.5 ;
scatter(x(idx),y(idx),10,z(idx),'filled')
title('points for which z < = 0.5')

  2 Comments

Thanks a lot, but I need to have a scroll bar on the same figure to scroll through different z position..
KSSV
on 31 Oct 2018
You have the options of pan, datatip, zoom etc...

Sign in to comment.