I have a set of vectors in the shape of a n by m matrix from which I would like to calculate m normplots superimposed. This is easy:
c=rand(100,10);
figure
normplot(c)
The normplot automatically colors each column of data, but I would like to control how they are colored. Specifically I need to make them greyscale. The first set of data (column 1) should be white (or close to white) and the last one black.
By obtaining the handles to the plotted lines you could something like this:
close all;
n = 100;
m = 10;
doc=rand(n,m);
figure;
% obtain the handle h to the dotted lines
h = normplot(doc);
% define colormap
g = colormap('gray');
for i = 1:m
%set(h([1 11 21]),'color','r') % to set color to red
%set(h([1 11 21]),'marker','o') % to change marker
% mapping into greyscale color map (g has size 64x3)
set(h([i i+m i+2*m]),'color',g(round(i * size(g,1)/m),:));
end

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With