Display markers at given points for multiple lines and fixing legend entry

10 visualizaciones (últimos 30 días)
Osh
Osh el 29 de Abr. de 2016
Comentada: Osh el 29 de Abr. de 2016
I have the following basic example to illustrate a plot for three lines.
xaxis=[1 2 3 4]
p1=[56 57 58 62];
p2=[14 16 34 38]
p3=[22 24 28 31];
I would like to add a marker at the following data points in each of the 3 lines
xmarkers=[1 3 4];
ymarkers=[56 34 31];
plot(...
xaxis,p1,'o-',xmarkers(1),ymarkers(1),'k*',...
xaxis,p2,'o-',xmarkers(2),ymarkers(2),'k*',...
xaxis,p3,'o-',xmarkers(3),ymarkers(3),'k*'...
)
with the following legend entry:
legend('line plot 1','line plot 2','line plot 3','Location','Northwest')
How can I remove additional markers (*) point from the legend?

Respuestas (1)

KSSV
KSSV el 29 de Abr. de 2016
plot(xaxis,p1,'o-',xmarkers(1),ymarkers(1),...
xaxis,p2,'o-',xmarkers(2),ymarkers(2),...
xaxis,p3,'o-',xmarkers(3),ymarkers(3)...
)
  1 comentario
Osh
Osh el 29 de Abr. de 2016
It doesn't show the extra markers / data point labels I need to highlight in the plot

Iniciar sesión para comentar.

Categorías

Más información sobre Legend en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by