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

Continuous colour maps #1585

Closed
AlistaiReid opened this issue Jun 3, 2016 · 2 comments
Closed

Continuous colour maps #1585

AlistaiReid opened this issue Jun 3, 2016 · 2 comments

Comments

@AlistaiReid
Copy link

Rather than binning the area values, they could be mapped to a continuous interval. For example, we could:

  • 'equalise' the value distribution through a non-linear mapping - eg compute (area rank)/(number of areas) to obtain a value between 0 and 1
  • linearly map the values to the (0,1) interval by computing (y-y_min)/(y_max-y_min). This can be made more robust to data outliers by mapping between the nth and nth last percentiles, rather than the min and max.
  • apply any other transforms such as truncated logarithm

We then apply the colour map function to each value to compute a RGB colour. There are many choices of such functions in the literature, but a perceptually linear colour map would be a principled choice - Matplotlib implements a bunch of (often piecewise-linear) functions that could be easily ported to javascript:
http://matplotlib.org/examples/color/colormaps_reference.html
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/_cm.py

@stevage stevage added this to the 2016-08-30 NM milestone Jun 8, 2016
@tephenavies tephenavies self-assigned this Sep 6, 2016
@kring kring removed the D-2016-08-30 label Feb 5, 2018
@AnaBelgun AnaBelgun removed this from the 2016-08-30 Parlmap milestone Apr 19, 2018
@nf-s
Copy link
Contributor

nf-s commented Mar 14, 2021

For #3524

@nf-s
Copy link
Contributor

nf-s commented May 30, 2021

Duplicate issue #3441

@nf-s nf-s closed this as completed May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants