Open briochemc opened 2 years ago
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.
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 :)
Reopened while I consider this.
Just noticed that out of the diverging colorbrewer colormaps listed here
Only the first and last ones are oriented in the same way that https://colorbrewer2.org/#type=diverging is. In other words
rdylgn
,piyg
, andprgn
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) whilePuOr
starts with ~orange~ purple (edited)...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 forBuRd
in this case, which would go blue to red. What do you think?