Borrar filtros
Borrar filtros

Make certain plot markers invisible?

13 visualizaciones (últimos 30 días)
Benson
Benson el 13 de Jun. de 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!

Respuesta aceptada

Walter Roberson
Walter Roberson el 13 de Jun. de 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.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by