I am not sure how to approach this problem. I am trying to find good resources on how to customize a colormap (without using colormap editor) to set your colors and your boundaries for an image in Matlab. I have managed to do it using the colormap editor but I want to figure out how to do it manually.
I am trying to make a colormap that ranges between 0 and 127. The boundaries would be:
0 to 64 is black (0) to white (64)
65 to 127 is blue (65) to red (127)
Can someone give me some advice on how to manually make these changes to the colormap? A good resource would also be useful.
Thanks.
I suggest using
linspace. It helps you creating a uniform distribution of numbers in some range.The idea is to interpolate
[1 0 0]up to[0 0 1]; Each of the color channels, red green and blue is interpolated on its own.So I generated
l1both for the red and the blue channel, but flipped it in one of them.