Mark specific values on a plot!
Mostrar comentarios más antiguos
Hi consider the following plot:
x=1:100;
y=600+(1400-600).*rand(100,1);
plot(x,y)
How can I mark the y values between 900 and 1100? Thanks!
1 comentario
Rik
el 19 de Oct. de 2017
With hold on and plotting a line over it with an increased line width you could emphasize a certain range.
Respuesta aceptada
Más respuestas (1)
Hellen Nassuna
el 8 de Oct. de 2018
x=1:100;
y=600+(1400-600).*rand(100,1);
plot(x,y)
hold on;
yMark=NaN(1,100);%preallocation for speed
for i=1:1:length(y)
if(y(i)>=900 && y(i)<=1100)
yMark(i)=y(i);
end
end
plot(x,yMark,'->')
hold off
if true
% code
end
Categorías
Más información sobre Graphics Performance en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!