Colouring different regions on a graph.
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!