cmap icon indicating copy to clipboard operation
cmap copied to clipboard

Colorbrewer colormap orientations are inconsistent

Open briochemc opened this issue 3 years ago • 3 comments

Just noticed that out of the diverging colorbrewer colormaps listed here

Screen Shot 2022-03-31 at 3 34 42 pm

Only the first and last ones are oriented in the same way that https://colorbrewer2.org/#type=diverging is. In other words rdylgn, piyg, and prgn should be reversed to match the original colormaps. Note that I have not checked other colormaps!

I think colorbrewer chose these orientations because we traditionally expect red-ish colors to represent the most positive values (i.e., at the top/right/end of the colormap).


That being said, colorbrewer's naming convention itself is not consistent, e.g., RdBu starts with blue (at the bottom) while PuOr starts with ~orange~ purple (edited)...

Screen Shot 2022-03-31 at 3 48 20 pm Screen Shot 2022-03-31 at 3 48 13 pm

So maybe it is worth correcting colorbrewer's inconsistency here and only having names that match the color order? I.e., RdBu would go from red to blue. An ideal solution is probably to also allow for BuRd in this case, which would go blue to red. What do you think?

briochemc avatar Mar 31 '22 04:03 briochemc

Good catch. I have opted instead to match the diverging colormap order to their names rather than the original orders. This required reversing of the RdBu colormap. The colormaps can be easily reversed using MATLAB's built-in flipud(...) function.

Fixed in the master branch.

tsipkens avatar Apr 01 '22 03:04 tsipkens

The colormaps can be easily reversed using MATLAB's built-in flipud(...)

I know! I meant we could easily add in convenience functions that go, e.g.,

function cm = pubu(n, opt_interp)
    cm = flipup(bupu(n, opt_interp))
end

Given your decision to opt for "the colormap follows the name order", this would be nice IMHO :)

briochemc avatar Apr 01 '22 08:04 briochemc

Reopened while I consider this.

tsipkens avatar Apr 02 '22 17:04 tsipkens