Mark specific values on a plot!
Mostra commenti meno recenti
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 Commento
Rik
il 19 Ott 2017
With hold on and plotting a line over it with an increased line width you could emphasize a certain range.
Risposta accettata
Più risposte (1)
Hellen Nassuna
il 8 Ott 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
Categorie
Scopri di più su Graphics Performance in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!