-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add cividis colormap #1546
Add cividis colormap #1546
Conversation
Can one of the admins verify this patch? |
@phsft-bot build |
Starting build on |
Build failed on mac1013/native. Warnings:
And 10 more Failing tests: |
From the output, it doesn't seem the build failure was caused by my changes. I do not have access to the full log, though. So, if I need to fix something it would be nice if someone with access could provide the full output... |
Yes, the error is unrelated to your patch (infrastructure problem). |
@couet Could you take a look at this PR? Thanks. |
After fixing two small mistakes in your code the new palette is now working. Thanks ! |
Great! I missed the array dimension from when I compared to the 18 stop version... Sorry for that. The 62 -> 63 change escaped me completely. It might be better to calculate total number minus first number (113 - 50) with named constants instead of magic numbers to make this more visible... |
Yes 63 can be calculated but in that case 113 will need to be set. Yes we can have a named constant but the comment on the ligne setting 63 is clear enough I guess. |
Yes adding a last dummy palette number might help to compute the value automatically. But then it will appear in the enum description in the online help ... That's not very clean ... |
Certainly. I was indeed thinking in the direction of your second comment... But, sure, it's not the highest priority. |
This adds cividis as 113th colormap to TColor, as well as the palettes tutorial.
This colormap aims to solve problems that people with color vision deficiency have with the common colormaps. For more details see:
Nuñez J, Anderton C, and Renslow R. Optimizing colormaps with consideration for color vision deficiency to enable accurate interpretation of scientific data.
https://arxiv.org/abs/1712.01662
The colormap stops have been interpolated from the (256 stops) Fiji/ImageJ version [1] and cut down to the 9 stops that ROOT uses (using the scipy Akima interpolator). Alternatively, the official* (18 stop) version committed to plotly.py [2] could be used, which would mean a slight deviation from the other palettes (see code below). In the plot produced by the palette tutorial the difference between the 9 and 18 stops seems negligible, hence sticking to the ROOT default values seems appropriate.
*Meaning committed by the original author.
[1] https://github.com/fiji/fiji/blob/master/luts/cividis.txt
[2] plotly/plotly.py#883