-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: add Paul Tol's colormaps #48
Conversation
thanks @Jhsmit! |
isn't yet supported, but i see no reason why not. will add a new feature tracking issue |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #48 +/- ##
==========================================
+ Coverage 96.49% 96.55% +0.05%
==========================================
Files 151 152 +1
Lines 1884 1915 +31
==========================================
+ Hits 1818 1849 +31
Misses 66 66 ☔ View full report in Codecov by Sentry. |
you can preview the new docs here if you want to make sure everything looks good to you: |
hmm, i can probably figure out how to sort better using natural sorting somehow. I think we should name them based on how you suspect people would want to enter them. I think it's probably a bit harder to remember the zero padding |
There is the |
yep. ok for merge here then? And we figure out display sorting in the docs elsewhere? |
Yes sounds good. There is still the colour map for ground cover mentioned on Paul's web page but it can be added later. |
one thing I'm noticing is that colorbrewer uses this pattern for discrete/continuous:
so, what would you think of calling them simply:
instead of |
Yes, I agree. I named them The piece of information that the colormap is discrete is already contained in the flag Maybe, and this would probably be a breaking change / refactor, you could consider something like this: Colormap('tol:rainbow_whbr`, interpolation=True, ncolors=5)
>>> `returns what is now 'rainbow discrete_5' Colormap('colorbrewer:accent`, interpolation=True, ncolors=5)
>>> `for qualitative colormaps, without predefined order of colors (such as tol:rainbow), returns the first 5 colors` Colormap('bids:fake_parula`, interpolation=True, ncolors=5)
>>> `for sequential colormaps, return 5 colors linearly sampled, ie cmap(norm(np.linspace(0, 1, num=5, endpoint=True))` The advantage would be you can significantly condense the colormap catalog this way since all the sets of various discrete/qualitative colormaps would merge into one. However, maybe its confusing that |
yeah, I noticed that later as well. I do think that's definitely worth strongly considering, so I'm less worried about leaving it as is.
yep
I think I'd prefer to leave the n in the name, even though it's leads to a bit more verbosity in the catalog. Primarily, because most of the catalog items with a number in them closely mirror the way those names are used in other colormap libraries. all told, I think i'm fine leaving everything as is. :) thanks for taking the time to weigh in! |
This PR add Paul Tol's colormaps: https://personal.sron.nl/~pault/
fixes #45
test_catalog_data
test fails because it doesnt expect tuples.globals
(via `globals().update(...)). If you prefer, I can instead also write a codegen function and hard-code the output.cmap
, as far as I can tell they are all reproduced correctly.Some of Paul Tols colormaps also include a color value for 'bad' values (missing, inf, nan), is this something that is supported by
cmap
? or will be in the future?