Effacer les filtres
Effacer les filtres

Make certain plot markers invisible?

13 vues (au cours des 30 derniers jours)
Benson
Benson le 13 Juin 2013
set(0,'DefaultLineMarkerSize',6);
plot(x,y,'red.-');
I have some points touching the x-axis (y-value is 0). For these particular points, I want to make the markers invisible.
Also, I want all the points to be plotted. So plot(x,y(y>0),'red.-'); where x is modified earlier in the script to have the same vector length as y(y>0) wouldn't work.
Any help is appreciated. Thanks!

Réponse acceptée

Walter Roberson
Walter Roberson le 13 Juin 2013
You cannot modify individual markers of a line() or lineseries() object such as are created by line() or plot().
What you can do is plot() without the markers and the scatter() the markers into place. Or you can plot() without the markers and the plot() again with
hold on; plot(x(y>0), y(y>0), 'r.')
which would plot only markers at those locations, with no lines.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by