Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

linearlyMapArrayToColors.m 300 B

1234567891011
  1. function colors = linearlyMapArrayToColors(xArray, colorMap)
  2. % Normalize to range 0-1.
  3. if ~range(xArray(:)) == 0
  4. xArray = (xArray - min(xArray(:))) / range(xArray(:));
  5. end
  6. nColors = size(colorMap, 1);
  7. colorInds = floor(xArray * (nColors - 1)) + 1;
  8. colors = colorMap(colorInds, :);
  9. end