set default line marker symbol

35 vues (au cours des 30 derniers jours)
Simon Hager
Simon Hager le 27 Mar 2020
how to set default line marker symbol to 'x' instead of none. Should be possible with:
set(0,'DefaultLineMarker','x');
still there are no markers in new plots. thanks!

Réponse acceptée

the cyclist
the cyclist le 28 Mar 2020
Modifié(e) : the cyclist le 28 Mar 2020
See this answer from Mathworks support.
  3 commentaires
the cyclist
the cyclist le 30 Mar 2020
From this documentation page, I would have expected
set(groot,'defaultLineMarker','x')
to do what you want, but it doesn't seem to do it.
I verified that
set(groot,'defaultLineMarkerSize',60)
does make the size larger. I'm puzzled.
Simon Hager
Simon Hager le 30 Mar 2020
It' the same with me!

Connectez-vous pour commenter.

Plus de réponses (1)

dave grundy
dave grundy le 20 Juil 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...

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by