Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colorbrewer colormap orientations are inconsistent #4

Open
briochemc opened this issue Mar 31, 2022 · 3 comments
Open

Colorbrewer colormap orientations are inconsistent #4

briochemc opened this issue Mar 31, 2022 · 3 comments

Comments

@briochemc
Copy link
Contributor

briochemc commented Mar 31, 2022

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?

@tsipkens
Copy link
Owner

tsipkens commented Apr 1, 2022

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 tsipkens closed this as completed Apr 1, 2022
@briochemc
Copy link
Contributor Author

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 :)

@tsipkens tsipkens reopened this Apr 2, 2022
@tsipkens
Copy link
Owner

tsipkens commented Apr 2, 2022

Reopened while I consider this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants