Switch to a dark theme

By default, CARTOframes uses Positron, a light basemap with light themed widget and legend panels. When the basemap is swithed to Dark Matter and legends and widgets are present, the theme updates accordingly.

In the example below, by setting the basemap parameter to darkmatter, all map components switch to a dark theme that is better suited for the dark basemap.


In [1]:
from cartoframes.auth import set_default_credentials
from cartoframes.viz import Map, Layer, basemaps, color_category_style

set_default_credentials('cartoframes')

In [3]:
Map(
    Layer(
        'pittsburgh_311',
        color_category_style('request_type', top=3, palette='[#4ABD9A,#4A5798,#F9CA34]'),
        title="Requests"
    ),
    basemap=basemaps.darkmatter
)


Out[3]:
:
StackTrace
    ">