How does it make the background of that country? (Plotly)

448 Views Asked by At

I write python plotly express to make a choropleth map
this my code

import plotly.express as px
import pandas as pd

th_json = "https://raw.githubusercontent.com/apisit/thailand.json/master/thailand.json"

df = pd.read_csv("province-test.csv")

fig = px.choropleth_mapbox(df, geojson=th_json, color="value",
                           locations="provinces", featureidkey="properties.name",
                           center={"lat": 13.736717, "lon": 100.523186},
                           mapbox_style="open-street-map", zoom=4)
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()

(result)enter image description here but I want the background like this (picture 2) I write it with python folium enter image description here
I would like to get a background of Choropleth with all province of the country for province not in the data frame and province in the data frame show color theme (Plotly Express)
How can I make the background the country (pic 2) with Plotly Express?

0

There are 0 best solutions below