Azzera filtri
Azzera filtri

Make certain plot markers invisible?

13 visualizzazioni (ultimi 30 giorni)
Benson
Benson il 13 Giu 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!

Risposta accettata

Walter Roberson
Walter Roberson il 13 Giu 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.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by