With reference to this previous post Getting different colors for different numbers using `spy` in Matlab
where it was suggested the following in order to have different values of spy represented with different colors
spy(a,'k')
hold on
spy(a==10,'r')
spy(a==9,'b')
hold off
How can I do if I would like to use RGB definitions? For example having [ 0.6 0.2 0] for all elements =10 and [0.8 1 0] for all elements =9 instead of the already defined r, b and k etc?
The following does not work because all the Spy matrix will be of a certain color,
set(get(gca,'children'),'color',[0.6 0.2 0])
Thanks, M.