I want to plot both lines of my estimations and dots of data.
And add legend only for lines.
Here is my matlab code.
%plot lines
%-----------------------------------------
p_me = plot(real(G_me),imag(G_me));
p_me.Color = '#A2142F' %red
hold on;
p_0 = plot(real(G_0),imag(G_0));
p_0.Color = '#EDB120' %yellow
p_1 = plot(real(G_1),imag(G_1));
p_1.Color = '#77AC30' %green
p_2 = plot(real(G_2),imag(G_2));
p_2.Color = '#4DBEEE' %light blue
p_3 = plot(real(G_3),imag(G_3));
p_3.Color = '#0072BD' %blue
p_10 = plot(real(G_10),imag(G_10));
p_10.Color = '#7E2F8E' %purple
legend('1','2','3','4','5','6')
%plot dots
%-----------------------------------------
for i = (1:60)
for j = (1:100)
if analyzedData(i).Md(j) < 10 plot(analyzedData(i).data(j,1),analyzedData(i).data(j,2),'k.','MarkerSize',3);
end
end
end
hold off;
It works, but it also add needless legends of every single dot.
Like this
How can I keep only legends of lines? What should I modify in my code?