0
votes

I want to understand colormap of matlab.

colormap(map) JET Variant of HSV JET(M), a variant of HSV(M), is an M-by-3 matrix containing the default colormap used by CONTOUR, SURF and PCOLOR. The colors begin with dark blue, range through shades of blue, cyan, green, yellow and red, and end with dark red. JET, by itself, is the same length as the current figure's colormap.

It means it shows 0 =dark blue, 1=darkred.

But for 0

f=0
cm = colormap(jet(256));% should I take 256
colorID = max(1, sum(f> [0:1/length(cm(:,1)):1])); 
myColor= cm(colorID, :) 

myColor = 0 0 0.50

why not ( 0 0 1)%darkblue

  f=1
    cm = colormap(jet(256));% returns the current color map
    colorID = max(1, sum(f> [0:1/length(cm(:,1)):1])); 
    myColor= cm(colorID, :) % returns your color

myColor = 0.50 0 0

why not( 1 0 0)% darkred

1
Are you aware of the syntax: ImageRGB = ind2rgb(Image,colormap) - Cape Code
I solved it with a software. It is cloud compare and opensource. - Shahgee

1 Answers

0
votes

Red is not defined by the RGB values [1 0 0]. Lots of RGB values would be called red by people. The same goes for blue. Also, the help text for the jet colormap states:

The colors begin with dark blue, ... and end with dark red.

Well I would say that the RGB color [0 0 0.5] looks dark blue to me, and that the RGB color [0.5 0 0] looks dark red to me. So the colormap agrees with the description, doesn't it?

If you are asking why MathWorks have chosen for the jet colormap to start at dark blue rather than blue, and for it to end at dark red rather than red, then I would simply ask "Why shouldn't it?".