How to use the branca.colormap function in branca

To help you get started, we’ve selected a few branca examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github python-visualization / branca / tests / test_colormap.py View on Github external
def test_simple_step():
    step = cm.StepColormap(['green', 'yellow', 'red'],
                           vmin=3., vmax=10.,
                           index=[3, 4, 8, 10], caption='step')
    step = cm.StepColormap(['r', 'y', 'g', 'c', 'b', 'm'])
    step._repr_html_()
github python-visualization / branca / tests / test_colormap.py View on Github external
def test_simple_linear():
    linear = cm.LinearColormap(['green', 'yellow', 'red'], vmin=3., vmax=10.)
    linear = cm.LinearColormap(['red', 'orange', 'yellow', 'green'],
                               index=[0, 0.1, 0.9, 1.])
    linear._repr_html_()
github JustinGOSSES / predictatops / predictatops / plot.py View on Github external
import os
import folium

# print(folium.__version__)
import branca.colormap as cm
import os
import math

# env = %env
# pd.set_option('display.max_rows', 2000)

center2 = [54.840471, -110.269399]
zoom2 = 6


linear2 = cm.LinearColormap(
    ["#edf8b1", "#7fcdbb", "#2c7fb8", "#273891"], vmin=-100, vmax=75
)

print(linear2)


def depth_color(depth):
    if math.isnan(depth):
        print(" math.isnan(depth) => ", depth)
        return "blue"
    else:
        depth = float(depth)
        if depth >= 50:
            color = "#3182bd"
        elif depth > 10 and depth < 50:
            color = "#9ecae1"
github JustinGOSSES / predictatops / StratPickSupML / evaluate.py View on Github external
########## imports ########
import os
import folium
#print(folium.__version__)
import branca.colormap as cm
import os
import math
#env = %env
#pd.set_option('display.max_rows', 2000)

center2 = [54.840471, -110.269399]
zoom2 = 6



linear2 = cm.LinearColormap(
    ['#edf8b1','#7fcdbb','#2c7fb8','#273891'],
    vmin=-100, vmax=75
)

print(linear2)

def depth_color(depth):
    if(math.isnan(depth)):
        print(" math.isnan(depth) => ", depth)
        return 'blue'
    else:
        depth = float(depth)
        if depth >= 50:
            color = '#3182bd'
        elif depth > 10 and depth < 50:
            color = '#9ecae1'
github JustinGOSSES / predictatops / predictatops / map.py View on Github external
import os
import folium

# print(folium.__version__)
import branca.colormap as cm
import os
import math

# env = %env
# pd.set_option('display.max_rows', 2000)

center2 = [54.840471, -110.269399]
zoom2 = 6


linear2 = cm.LinearColormap(
    ["#edf8b1", "#7fcdbb", "#2c7fb8", "#273891"], vmin=-100, vmax=75
)


def depth_color(depth):
    if math.isnan(depth):
        print(" math.isnan(depth) => ", depth)
        return "blue"
    else:
        depth = float(depth)
        if depth >= 50:
            color = "#3182bd"
        elif depth > 10 and depth < 50:
            color = "#9ecae1"
        elif depth > -10 and depth < 10:
            color = "green"