2.2 Mapping Values to Colors
- In the code below, the number of classes is defined, as well as each color for each of the classes. It says Array(5), so there are 5 different classes and 5 different colors that will represent the data. I chose a color scheme from ColorBrewer that was based on a single hue of blue with varying lightness. Smaller values appear lighter, and higher values have a greater hue.
- Nested functions are basically functions that rely on how a function is defined elsewhere within the code. For example, the line two lines down that says "naturalbreaks =" relies on how my variable, "pct_wht" is defined as well as how my color scheme "blue" is defined, which I defined on the line above. Having nested functions makes it so that all of your lines are working together and connected.