Make dots in scatter Plot Change Color Slightly Each time.
4 views (last 30 days)
Show older comments
Hi everyone, I have a scatter plot that plots two vectors reflec_2016 & reflec_2011.
Both vectors are 177 by 1. My question is there a way to have dots change color slightly each time a dot is plotted on the scatter plot (e.g. start with blue for the first dot and end with red for the last dot), because the scatter plot is graphing reflectance over reflectance, but I also want to know if a particular dot was the first number combination in my vectors or the middle or end of reflec_2016 & reflec_2011, because the order of the numbers in those two vectors is order by wavelength. Right now I have a plot that comes up and all the dots are the same color, and I can click on a dot for the coordinates and find where that is in the two single column vectors but I want to color coat them so I can tell that way if it was first middle of near the end of reflec_2011/2016
figure(1005)
scatter(reflec_2016.sears, reflec_2011.sears);
axis([0 10000 0 10000]);
legend('Reflectance of 2016 vs 2011')
Thanks a ton! Ben
1 Comment
Answers (1)
Walter Roberson
on 25 Jul 2016
pointsize = 14; %adjust as needed
numpoints = length(reflec_2016.sears)
pointidx = 1 : numpoints;
scatter(reflec_2016.sears, reflec_2011.sears, pointsize, pointidx);
colormap( jet(numpoints) )
0 Comments
See Also
Categories
Find more on Scatter Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!