Color continuous legend

The color-continuous type draws a continuous color legend based on your data's geometry using either the color (default) or strokeColor property of your visualization.

To view available legend parameters, run help(color_continuous_legend).

In this example, the color-continuous legend colors and labels ranges for an unclassed map using the color property.


In [1]:
from cartoframes.auth import set_default_credentials
from cartoframes.viz import Layer, color_continuous_style, color_continuous_legend

set_default_credentials('cartoframes')

In [2]:
Layer(
    'demographics_sf',
    color_continuous_style('masters_percent'),
    legends=color_continuous_legend(
        title="Percent Master's Degree",
        description='by block group',
        footer='Data: US Census',
        format='.0%'
    )
)


Out[2]:
Data: US Census
:
StackTrace
    ">