How do I use >7 colours on a scatter plot?
1 次查看(过去 30 天)
显示 更早的评论
Hi guys,
I have 62 time-distance plots (all stored in 'Picks' =[t,d,62] ) and want to display them together; But I can only produce a plot with a max of 7 colours (plot attached).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/165671/image.jpeg)
is there (i) a way to get 62 colours or better (ii) a way I can change plot symbol every 7 colours? (eg ., X, * ... so I dont reuse the same markers)
this is my code
for i = 1:62;
scatter(Picks(:,2,i), Picks(:,1,i),'.');
hold on ;
leg{i}=['FFID',num2str(i+365)];L{i}=i;
end;
a=~isnan(cell2mat(L)); l=leg(a); legend(l); hold off
Any help would be really appreciated! Thank you
Andy
0 个评论
回答(1 个)
Walter Roberson
2016-6-4
pointsize = 25;
scatter(Picks(:,2,i), Picks(:,1,i), pointsize, i, '.');
and after
colormap(jet(62))
The i will be used as the colormap index.
2 个评论
Walter Roberson
2016-6-5
col = repmat(i, size(Picks,1), 1);
scatter(Picks(:,2,i), Picks(:,1,i), pointsize, col);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scatter Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!