Black Lives Matter. Please consider donating to Black Girls Code today.

Continuous color argument in px.treemap

Looking at the example here:

The figure has a legend. I can’t see where that’s coming from? Is it something in addition to the example code?

import as px
import numpy as np
df =“year == 2007”)
df[“world”] = “world” # in order to have a single root node
fig = px.treemap(df, path=[‘world’, ‘continent’, ‘country’], values=‘pop’,
color=‘lifeExp’, hover_data=[‘iso_alpha’],
color_continuous_midpoint=np.average(df[‘lifeExp’], weights=df[‘pop’]))