legendΒΆ

legend([p, ]lab, [x, y, ]...)
legend([p, ]lab, [xy, ]...)

Add a legend to plot p (or to the current plot if p is not specified), assigning the labels defined in the vector of strings lab to the components of the plot (labels must follow the order of the components).

The position of the legend is defined by the coordinates x, y, which can be given separately or in a vector or tuple.