How can I create threshold line red color?

9 visualizaciones (últimos 30 días)
nazmican
nazmican el 21 de Dic. de 2022
Comentada: nazmican el 21 de Dic. de 2022
load('Vepdata3.mat');
hLen=length(h);
figure;
plot(EEGdata); %plot EEGdata
xlabel('time(s)');
ylabel('Amplitude(microA)');
hold on;
threshold=40;
thresholdLine=40; % Draw a horizontal line at y = 40;
plot(thresholdLine,'r-');
title('thresholdLine');
xlabel('time(s)');
ylabel('Amplitude(microA)');
  1 comentario
Askic V
Askic V el 21 de Dic. de 2022
Please have a look at:
https://www.mathworks.com/help/matlab/ref/yline.html

Iniciar sesión para comentar.

Respuesta aceptada

Image Analyst
Image Analyst el 21 de Dic. de 2022
Editada: Image Analyst el 21 de Dic. de 2022
Try yline
yline(threshold, 'Color', 'r', 'LineWidth', 2);
instead of what you have
thresholdLine=40; % Draw a horizontal line at y = 40;
plot(thresholdLine,'r-');

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by