MATLAB Answers

Kobi
0

how to mark 2D plot with shapes for long array?

Asked by Kobi
on 7 Oct 2018
Latest activity Edited by jonas
on 7 Oct 2018
trying to mark 2D plots with shapes using the following command:
h=semilogy(lambda,Hb);
set(h,'linestyle','-','color','b','marker','s')
a problem occure when the plots are for large array of vectors, then the shapes are crammed up and i cant really distinguish from them.
what can i do?

  0 Comments

Sign in to comment.

Products


Release

R2016a

1 Answer

Answer by jonas
on 7 Oct 2018
Edited by jonas
on 7 Oct 2018
 Accepted Answer

Use the 'markerindices' argument, introduced in 2016b
plot(x, y, 'markerindices', [1:10:lenght(x)])
puts markers on every 10th point. In older released you need to use something like
plot(x, y, 'k-',...
x(1:10:end),y(1:10:end),'ko')
Which is really annoying as you get 2 different line objects.

  0 Comments

Sign in to comment.