Created
November 6, 2017 19:24
-
-
Save yvan/c73ce9a819f68040928462824bc4531f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blue = [65,105,225] | |
green = [34,139,34] | |
beach = [238, 214, 175] | |
def add_color(world): | |
color_world = np.zeros(world.shape+(3,)) | |
for i in range(shape[0]): | |
for j in range(shape[1]): | |
if world[i][j] < -0.05: | |
color_world[i][j] = blue | |
elif world[i][j] < 0: | |
color_world[i][j] = beach | |
elif world[i][j] < 1.0: | |
color_world[i][j] = green | |
return color_world | |
color_world = add_color(world) | |
toimage(color_world).show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment