How to combine 2 graphs in one legend entry?
이전 댓글 표시
Hello, i have 6 arrays of data that i want to plot but each 2 are combined. I already changed the colour of each plots so they fit together in my figure but now i have the problem that the legend doesn't works how i want to. The colours don't match.
Here's my code.
I want
plot(t_1,CH0_1,'r');
title('Measurement');
hold on;
plot(t_2,CH0_2,'r');
hold on;
% T1 and T2 combined together
plot(t_8,CH0_8,'m');
hold on;
plot(t_7,CH0_7,'m');
hold on;
% T7 and T8 combined together
plot(t_10,CH0_10,'b');
hold on;
plot(t_11,CH0_11,'b');
% T11 and T12 combined together
legend('Data1','Data2','Data3'); % Legend for all plots
Currently it looks like this. I want a legend where Data1 is red, Data2 magenta and Data 3 blue.
Can anyone help me here?

채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
