Matlab Legend Issue - I'm always getting legend for data1, but not for data2. Could you kindly let me know what I'm doing wrong? Thank you.

2 次查看(过去 30 天)
Stuct_1 = 1x10 struct
Stuct_2 = 1x10 struct
for i = 1:10
figure(1)
y = struct_1(i).times.*1000;
y1 = struct_0(i).times.*1000;
s0 = scatter(y,i,100,'r.');
hold on
s1 = scatter(y1,i,40,'ko');
end
legend([s0, s1], {'Data1', 'Data2'})

采纳的回答

VBBV
VBBV 2022-11-5
legend([s0(1), s1(1)], {'Data1', 'Data2'})

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by