How to make equally spaced symbols on a line plot
8 views (last 30 days)
Show older comments
I have a line plot (created from an array with many many points) and I want to use symbols rather than colours to indicate the different data. Does anyone know how to do this?
I know you can't simply add 'o' at the end because this gives error message 'The end operator must be used within an array index expression'
Cheers!
2 Comments
Answers (1)
Voss
on 24 Jul 2023
Do you want something like this?
x = 1:100;
y = sin(x/10);
plot(x,y) % the whole line
hold on
plot(x(1:10:end),y(1:10:end),'bo') % markers every so often
4 Comments
Voss
on 24 Jul 2023
Edited: Voss
on 24 Jul 2023
Instead of this:
plot(s9a(end-1000:10:end,1)*10^-6, s9a(end-1000:10:end,3)*10^9,'Color',c(5,:), 'o')
Do this:
plot(s9a(end-1000:10:end,1)*10^-6, s9a(end-1000:10:end,3)*10^9,'o','Color',c(5,:))
Property/Value pairs, like 'Color',c(5,:), must come at the end of the list of arguments to plot.
See Also
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!