I have a simple 2-color map showing which candidates won in which precinct. Now I want to make one showing margin of victory within a precinct. So if candidate A won by a lot it would be dark green, if candidate A won by a little it would be light green, if candidate B won by a lot it would be dark yellow and if candidate B won by a little it would be light yellow. (These are local elections so red and blue don't make sense). I used color brewer to pick my initial two color scheme. I have zero design sense. How do I go about picking the colors for the margin of victory map?
-
You would probably have to standardize your data first so you can define "a lot" or "a little" by a number/ratio/percent. Then you could define your margin of victory upper/lower class breaks and then color your classes accordingly.– user21646Mar 19, 2014 at 1:55
-
@JasparKatt can you say about the appropriate way to standardize this kind of data. How do I decide what the bins should be?– bernie2436Mar 19, 2014 at 2:02
2 Answers
If you need to get color dynamically on a website, I would give you the advice of using the excellent chroma.js library. The library is easy to use and implements a scale mechanism which would fit to your needs :
scale = new chroma.ColorScale({
colors: ['#F7E1C5', '#6A000B']
})
scale.getColor(0.23)
- More on chroma.scales in the dedicated wiki page : https://github.com/gka/chroma.js/wiki/Color-Scales
- Predefined colors are listed here. 'OrRd' (red ramp) and 'Blues' (blue ramp) could be useful to you. See also 'spectral'.
There is the ColorBrewer Option in QGIS:
From the Layer Properties > Style > choose Categorized > from Colour Ramp choose New Colour Ramp > Select type Colour Brewer:
Or use the ColorBrewer website: http://colorbrewer2.org/
Pick a diverging colour scheme, maybe 5 data classes, then pick a colour scheme...
You can use those colours in whatever your mapping client is.