Colouring different regions on a graph.

1 回表示 (過去 30 日間)
Bhavick Singh
Bhavick Singh 2021 年 5 月 26 日
コメント済み: Bhavick Singh 2021 年 5 月 27 日
I have time series data which is non linear. It has really high and really low areas which I need to represent using different colours. Its a line graph. Please assist.

採用された回答

Jakob B. Nielsen
Jakob B. Nielsen 2021 年 5 月 26 日
Plot stepwise segments of your data? For example:
data=1000*rand(1000,1);
data=sort(data);
x=1:1:1000;
start=1;
figure
for i=1:100
if mean(data(start:start+10)) > 500
cc='r';
else
cc='b';
end
plot(x(start:start+10),data(start:start+10),cc);
hold on
start=i*10;
end
  1 件のコメント
Bhavick Singh
Bhavick Singh 2021 年 5 月 27 日
Hello, thanks for the answer. I have data in a excel spreadsheet. I have to draw a voltage vs time graph, and label the trends according to different colour. Please assist

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by