edit a surf plot

4 visualizaciones (últimos 30 días)
Fakhraddin Akbari Dourbash
Fakhraddin Akbari Dourbash el 21 de Mzo. de 2020
Comentada: Fakhraddin Akbari Dourbash el 21 de Mzo. de 2020
Hi, everyone. I have a surf plot which has 108*192 pixels (a f=tiff image converted to surf). I am only interested in the middle of the plot and I want to only show an area of say, x=1:10, 90:108 and y=1:10, 100:192. In other words, I want to remove everything outside of a square/circle (defined either by pixels or by interactively choosing it) in the middle.
Many thanks
  4 comentarios
darova
darova el 21 de Mzo. de 2020
Can you show the code? And how are you trying to do this?
Fakhraddin Akbari Dourbash
Fakhraddin Akbari Dourbash el 21 de Mzo. de 2020
Sure, the last part of the code:
x = 1:108;
y = 1:192;
[X,Y]=ndgrid(x,y);
surf(X,Y,T,'EdgeAlpha',.1);
M=jet
colormap(M)
colorbar
T is a fucntion after processing all the pixels and gives me the height in the surf plot.

Iniciar sesión para comentar.

Respuesta aceptada

darova
darova el 21 de Mzo. de 2020
Try this
x = 1:108;
y = 1:192;
[X,Y]=ndgrid(x,y);
ii = 90:108;
jj = 100:192;
surf(X,Y,T,'EdgeAlpha',.1);
alpha(0.5)
hold on
surf(X(ii,jj),Y(ii,jj),T(ii,jj))
hold off
M=jet
colormap(M)
colorbar
  1 comentario
Fakhraddin Akbari Dourbash
Fakhraddin Akbari Dourbash el 21 de Mzo. de 2020
Gives me exactly what I wanted. Thanks. Appreciate it.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by