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

Custom colour maps #60

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Custom colour maps #60

wants to merge 5 commits into from

Conversation

burggraaff
Copy link
Contributor

I've added the ability to use different colour maps. While the default is great most of the time, this change should allow for more customisation without adding too much complexity.

The colour map can be selected in the terminal using the -c or --color-map argument with the name of the colour map. By default, the map will be imported from branca (which folium requires, so no new dependencies). Additional options are matplotlib (mpl.<name>) and cmcrameri (cmc.<name>) – these are only imported when used, so it only adds optional dependencies. The selected colour map is converted into a gradient of hex strings, because this is what the folium HeatMap plugin requires; support for directly passing a colour map object should be added to folium at some point.

Some examples:

  1. Default (no change)
    ghm default

  2. Paired_12
    ghm Paired_12

  3. Set1_09 with blur -b 2
    ghm Set1_09 -b2

  4. mpl.cividis
    ghm mpl cividis

  5. cmc.lajolla with blur -b 2
    ghm cmc lajolla -b2

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

Successfully merging this pull request may close these issues.

1 participant