I am trying to add static labels to a choropleth chart. However, I did not find any information as to how to do that. I would like to display the values (right now all 0 obviously) number statically on the map.
I am currently building my chart like this:
import plotly.express as px
import pandas as pd
from urllib.request import urlopen
URL = "https://raw.githubusercontent.com/isellsoap/deutschlandGeoJSON/master/4_kreise/4_niedrig.geojson"
with urlopen(URL) as response:
counties = json.load(response)
df = pd.DataFrame(data=[feat['properties'].get('NAME_3') for feat in counties['features']],columns=['names'])
df['values'] = 0
fig = px.choropleth(
if __name__ == '__main__':
amazing! Thank you Alex, is there a way to customize the labels (i.e. size and color). I am also more than happy to read up on it in the documentation, but I couldn’t really find anything, however, I might be looking in the wrong locations.