Skip to content

Custom colour maps - #60

Open
burggraaff wants to merge 5 commits into
luka1199:masterfrom
burggraaff:cmap
Open

Custom colour maps#60
burggraaff wants to merge 5 commits into
luka1199:masterfrom
burggraaff:cmap

Conversation

@burggraaff

Copy link
Copy Markdown
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