MATLAB Answers

set default line marker symbol

24 views (last 30 days)
Simon Hager
Simon Hager on 27 Mar 2020
Answered: dave grundy on 20 Jul 2020
how to set default line marker symbol to 'x' instead of none. Should be possible with:
still there are no markers in new plots. thanks!

Accepted Answer

the cyclist
the cyclist on 28 Mar 2020
Edited: the cyclist on 28 Mar 2020
See this answer from Mathworks support.
Simon Hager
Simon Hager on 30 Mar 2020
It' the same with me!

Sign in to comment.

More Answers (1)

dave grundy
dave grundy on 20 Jul 2020
simon, the cyclist,
i came to the exact same conclusion as you both did regarding setting 'defaultLineMarker' and can't wait to hear from Mathworks as to why this doesn't work as we all thought it should.
i kept messing around with different options and was eventually able to get acceptable results instead using 'defaultAxesLineStyleOrder' such as:
set(0,'defaultAxesLineStyleOrder',{'-' '--o' '+'});
which will plot a series of solid lines, then a series of dashed lines with circle markers, and then a series using just + signs.
the aha moment came when i was looking at the Axes Properties documentation page:
in the Multiple Plots section, check out the explanation for LineStyleOrder, specifically it says:
"It changes to the next line style only after cycling through all the colors in the ColorOrder property with the current line style. The default LineStyleOrder has only one line style, '-'."
So, you can make it do what you want (i.e., plot only markers) but if you want to get a bit fancier, say, have markers AND colors change, as far as I can tell, that behavior is not possible and must be specified at each call to plot or line.
now, what i would really like to know is if we all stumbled upon a bug, and that, really, setting defaultLineMarker should do what we think...




Community Treasure Hunt

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

Start Hunting!

Translated by