MATLAB Answers

Delete/Hide points of a surface

118 views (last 30 days)
Kevin
Kevin on 18 Aug 2011
Commented: kiarash on 15 Oct 2020
Hello, quick question about a problem I have. Is it possible to delete or hide some points of a surface. I don't want to redraw the surface everytime but just make some points appear or disappear. Any idea ? Many thanks, Kevin

Accepted Answer

Titus Edelhofer
Titus Edelhofer on 22 Aug 2011
Hi Kevin,
something like this?
data = peaks(25);
h = surf(data);
pause(3);
% delete one point (in fact delete all 4 patches containing this point
data(3,3) = NaN;
set(h, 'zdata', data)
Titus
  2 Comments

Sign in to comment.

More Answers (1)

Chaowei Chen
Chaowei Chen on 21 Aug 2011
figure;hold on; h1=plot(1,1,'b.'); h2=plot(2,2,'r.'); hold off
% if you want to hide h2
set(h2,'visible','off')
% if you want to delete h2
delete(h2)
  2 Comments
Sam
Sam on 22 May 2020
Hello,
I have the same question but for the function 'probplot'.
It is more complex cause if you omitsome points , the probability plot changes...
I need a real hiding process that acts only on the plotted points and not on the raw data. This is pretty simple in JMP.Could you please advise ?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!