How can I create threshold line red color?

조회 수: 10 (최근 30일)
nazmican
nazmican 2022년 12월 21일
댓글: nazmican 2022년 12월 21일
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
Askic V
Askic V 2022년 12월 21일
Please have a look at:
https://www.mathworks.com/help/matlab/ref/yline.html

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2022년 12월 21일
편집: Image Analyst 2022년 12월 21일
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-');

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by