On 11/9/2012 8:43 PM, Stan wrote:
>
>> set(h,'Color',[1 1 1]) %change the rgb code based on index value
>> %make a mapping as needed to encode
>
> Okay, Thank you. That did work.
>
> My loop has i = 1:10. I tried [1, 1/i, 0.9]. However, this gave the same color for all 10 graphs.
>
> How would suggest that I set up the rgb values and encoding?
>
That was just an example. It gives the 'same' color, since
there was very little difference in the rgb code.
You need to figure out the rgb code to use based on the loop
index. You need to make a function which takes an integer
(the index), and returns a 3 element vector (the rgb code).
Based on the number of plots (maximum index), you should
be able to scale the rgb code so that it is uniformly
distributed from 0 to 1 over all the plots. It should be
easy to set up this function.
I do not know if 'ColorOrder' can be used to do this or not,
but you can look into it also. I did not use 'ColorOrder'
myself.
--Nasser
>
>> set(h,'Color',[1 1 1]) %change the rgb code based on index value
>> %make a mapping as needed to encode
>
> Okay, Thank you. That did work.
>
> My loop has i = 1:10. I tried [1, 1/i, 0.9]. However, this gave the same color for all 10 graphs.
>
> How would suggest that I set up the rgb values and encoding?
>
That was just an example. It gives the 'same' color, since
there was very little difference in the rgb code.
You need to figure out the rgb code to use based on the loop
index. You need to make a function which takes an integer
(the index), and returns a 3 element vector (the rgb code).
Based on the number of plots (maximum index), you should
be able to scale the rgb code so that it is uniformly
distributed from 0 to 1 over all the plots. It should be
easy to set up this function.
I do not know if 'ColorOrder' can be used to do this or not,
but you can look into it also. I did not use 'ColorOrder'
myself.
--Nasser