Answer:
See explanation
Step-by-step explanation:
if elevation <= 0:
#Below sea level
Color the pixel blue
elif elevation <= 6:
#Below the storm surge of Hurricane Sandy (flooding likely)
Color the pixel red
else:
#Above the 6 foot storm surge and didn't flood
Color the pixel green
To give us complete control of the coloring, we will create a new array that will hold the colors for each pixel. Here's an outline of our program:
Import the libraries to manipulate and display arrays.
Read in the NYC data and store in the variable, elevations
Create a new array, floodMap, to hold our colors for the map.
For each element in elevations, make a pixel colored by the schema above.
Load our image into pyplot.
Display the image.
We'll use a very simple (but a bit garish) color scheme, with our "blue" being 0% red, 0% green, and 100% blue. And similarly, the "red" and the "green" we'll use will be 100% of each, 0% of the others, giving a map like: