Opacity in legend

In this example, the color bins legend reads from the color property which has opacity set to 0.6. This is reflected in both the map and the legend.


In [1]:
from cartoframes.auth import set_default_credentials
from cartoframes.viz import Layer, color_bins_style, color_bins_legend

set_default_credentials('cartoframes')

In [2]:
Layer(
    'demographics_sf',
    color_bins_style('masters_percent', opacity=0.5),
    legends=color_bins_legend(
        title="Percent Master's Degree",
        description='by block group',
        footer='Data: US Census'
    )
)


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