Hi,
ı am trying to put a label on tiles based on a “CHANGE” or “COUNTY” item as shown below. I couldnt achieve it. Below is my sample code.
I tried with plotlyexpress or go method with the advice shown on:[Labels inside Counties for a map ] - looks like it only works for figure factory since scatter method is only avaialble for that one.
Any help wil lbe appreicatd.
fig = px.choropleth(stat_data, geojson=geo_json_data, color="CHANGE",
locations="COUNTY", featureidkey="properties.COUNTY",
projection="mercator",
color_continuous_scale=px.colors.diverging.RdYlGn, color_continuous_midpoint=2
)
fig.update_geos(fitbounds="locations", visible=False)
fig.show()
![map|690x432]
Hi @zakzakzak ,
This has already been discussed here:
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
import json
from urllib.request import urlopen
def main():
URL = "https://raw.githubusercontent.com/isellsoap/deutschlandGeoJSON/master/4_kreise/4_niedrig.geojson"
with urlopen(URL) as …
Alex-
1 Like
thank you very much. this is exactly what i was looking for. Thank you very much.
I suggest you to put this part of the information on how to make choropleth chart section as a tutorial everyone can benefit from it.
Thanks again.
Hi zakzakzak ,
Wanted to know how did you implemented this …I tried but still not getting the label on the chart