Show only two y values in a plot
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
KSSV
el 2 de Dic. de 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 comentarios
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!