How do i select data to legend in a plot ?
古いコメントを表示
Hello,
I didn't find the way to legend the data as i want. A little code to explain :
data1=10*ones(10,4)+randn(10,4);
t1=(0:1:9);
figure();
plot(t1,data1,'bo');
hold on
data2=25*ones(100,4)+2*randn(100,4);
t2=(0:0.1:9.9);
plot(t2,data2,'rx');
legend([{'From data1'},{'From data2'}]);
And I want to create a legend which say "Blue circle are from the data1" and "Red cross from the data2", in two lines.
Here, both text refers to blue circle - data1 -, i think it's normal since there is four plot of data1. If a put four {'From data1'} cells, the last one is a red cross, but i don't want to have a big legend.
Does anybody know how to display only one label per group (with good marks) ?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!