Show only two y values in a plot
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello all,
Any possible way to show only two value (0.02 and 0.04) for the y-axis, because the other values are just noise.
This is what I use for now to plot:
figure()
plot(time,wavelength,'b-x', 'LineWidth',2)
grid
axis tight
xlabel('Time')
ylabel('Wavelength')
hold on
Thank you!![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1216942/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1216942/image.jpeg)
9 Commenti
Risposte (1)
KSSV
il 2 Dic 2022
tol = 10^-3 ; % fix your tolerance
idx = abs(wavelength-0.02)<=tol | abs(wavelength-0.04)<=tol ;
plot(time(idx),wavelength(idx),'+r')
0 Commenti
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!