MATLAB Answers

Add extra marker to the plot?

27 views (last 30 days)
Happy New Year!
How can I add extra marker to a plot with several curves?
I mean suppose that the plot with several curves has already the legend with different markers. Now I want to add extra marker to some of the curves.
How can I do so?

  1 Comment

dpb on 1 Jan 2014
What does "extra" mean in this context, specifically?

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 1 Jan 2014
Edited: Walter Roberson on 1 Jan 2014
If you plot() with a linespec that has only a marker (or a marker and color) then the lines will not be drawn. Also scatter() will draw only markers.
plot(x, y, 'ro') %red circles but no line


Steven on 2 Jan 2014
But how can we have second legend?
Walter Roberson
Walter Roberson on 2 Jan 2014
You would have to custom construct the second legend by creating an axes to put it in, drawing the sample lines, positioning the text, and so on.
Or alternately, you could put an second axis before the first and attach a legend to that second axis.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!