How can I create threshold line red color?

7 ビュー (過去 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-');
  1 件のコメント
nazmican
nazmican 2022 年 12 月 21 日
Thank you :)

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by