How to choose color

Guideline: The order of colors in our “rainbow” is easy for everyone to understand, but this order is not universal and will make charts and maps harder to read.

Question: From this guide, it is true that any kind of order is not universal, it seems that if the order follows the light frequency spectrum, it will be better. What would you do when we want to separate data into different categories in color maps and how many colors at most should we use to visualize our multi-dimensional data and avoid misunderstanding or getting confused with colors?

Source: Krzywinski, M., Brol, I., Jones, S., & Marra, M. (2012). Getting into visualization of large biological data sets: 20 imperatives of information design. Poster presented at 2nd IEEE Symposium on Biological Data Visualization (BioVis 2012), Seattle, WA.