I\'m trying to plot scatter, something like:
scatter(coor(:, 2), coor(:, 3), 1, coor(:, 4));
The problem is, that I have quite big number o
You can use plot, but then all points have the same color. However, you can divide the set in different subsets and plot them each with their own color:
N = 100000;
x = rand(N,1);
y = rand(N,1);
C = sin(2*x)+y;
cdivs = 10;
[~, edges] = hist(C,cdivs-1);
edges = [-Inf edges Inf]; % to include all points
[Nk, bink] = histc(C,edges);
figure;
hold on;
cmap = jet(cdivs);
for ii=1:cdivs
idx = bink==ii;
plot(x(idx),y(idx),'.','MarkerSize',4,'Color',cmap(ii,:));
end
colormap(cmap)
caxis([min(C) max(C)])
colorbar
which responds already a lot better than scatter(x,y,1,C)
which gives about the same plot, but with higher color resolution (which is adjustable in my code above).