Iām trying to create a scattergeo plot with geojson and featureidkey attributes (see following code), but the output is not what I expect. The markers are shown and the map defined in geojosn file is not shown.
import json
import pandas as pd
import plotly.express as px
import geopandas as gpd
with open('7001/Malaysia.geojson') as file:
states = json.load(file)
vaccinated1 = pd.read_csv('7001/Vaccination Progress - 1st Vaccine Dose.csv')
fig1 = px.scatter_geo(vaccinated1.tail(16), geojson=states, locations="state",
featureidkey="properties.short",
color='percentage',
size="percentage",
center = {"lat": 6, "lon": 100.7129},
title = "Total vaccinated for 1st dose on {} (by Percentage)".format(vaccinated1.tail(16).iloc[0]['date']))
fig1.update_geos(fitbounds="locations", visible=False)
fig1.show()
What is missing in my example? Thanks in advance for your help
Data sample
vaccinated1.tail(16)
date state dose1 population percentage
2021/6/5 johor 215762 2839652 0.075982
2021/6/5 kedah 154556 1595396 0.096876
2021/6/5 kelantan 115698 1237273 0.093510
2021/6/5 kl 397752 1481138 0.268545
2021/6/5 labuan 15597 72272 0.215810
2021/6/5 melaka 62115 701711 0.088519
2021/6/5 ns 87744 850890 0.103120
2021/6/5 pahang 120502 1235357 0.097544
2021/6/5 penang 112720 1385097 0.081381
2021/6/5 perak 192738 1932525 0.099734
2021/6/5 perlis 38223 187756 0.203578
2021/6/5 putrajaya 26757 56913 0.470139
2021/6/5 sabah 171725 2921000 0.058790
2021/6/5 sarawak 219857 2072490 0.106084
2021/6/5 selangor 347114 4838547 0.071739
2021/6/5 terengganu 85595 841837 0.101676