<< jet | Graphics functions | line >> |
legend() |
legend(label1, ..., labelN) |
legend(labels) |
legend('off') |
legend('hide') |
legend('show') |
legend('toggle') |
legend('boxon') |
legend('boxoff') |
legend(ax, ...) |
legend(..., 'Location', lcn) |
legend(..., propertyName, propertyValue) |
L = legend(...) |
sets the legend labels: row vector characters.
cell array of character vectors or string array.
delete the legend.
toggle legend visibility.
hide legend.
show legend.
display box around legend.
hide box around legend.
axes to make current.
Legend location: a string ('NE' default).
a scalar string or row vector character.
a value.
a graphics object: axes type.
legend creates a legend in the current figure.
Location for legend on the plot:
'northeast' or 'NE': Top right (default).
'north' or 'N': Top center.
'south' or 'S': Bottom center.
'east' or 'E': Middle right.
'west' or 'W': Middle left.
'northwest' or 'NW': Top left.
'southeast' or 'SE': Bottom right.
'southwest' or 'SW': Bottom left.
f = figure();
x = linspace(0,10);
y1 = sin(x);
y2 = cos(x);
ax = gca();
plot(ax, x, y1);
plot(ax, x, y2);
legend('sin(x)', 'cos(x)', 'Location', 'N')
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET