help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Legend question


From: Nir Krakauer
Subject: Legend question
Date: Wed, 12 Nov 2014 15:28:12 -0500

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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]