Thank you both for your answers, I understood what the problem is. I will select the first answer just because it was published first.
Maybe I should make another post but I will write the following expansion here. The original problem is that I wanted to map the norm of a vector to a colour, so that bigger norms corresponded to red and small norms corresponded to blue. My initial approach was as follows:
colors = jet(length(normvec))
normvec = sort(normvec)
scatter3(comp1, comp2, comp3, 10, colors, 'filled')
However, in this way, really similar values still get quite different colours since the jet function generates them at a certain interval that has a fixed size (the problem is more relevant when a small data set is used).
For this reason, I tried to define the colours giving my norm vector directly and let Matlab do the job. Then however incurred the problem I showed you in the original post. The caxis command seems to be the solution to my problem, however, it still annoys me that if you have only two values, these are mapped to the extremes of the colormap (even though they have the same value). If you have a better solution to the 'original' problem I would really appreciate it.