I want to have markers of different sizes in a plot. So far my script looks like this:
n = 5;
x = 1:n;
y = sin(x);
p = plot(x, y, "d-"); #plot the line
l = legend('line');
set(p(1), "markersize", 0)
hold on
for i = 1:n
plot(x(i), y(i), "marker", "d", "markersize", i^2) #plot each point with a different marker size
endfor
hold off
The only problem is that once I set the original marker size to zero, the legend no longer displays the marker. How can I get a legend entry with the line and diamond marker?