I use the scatter_geo function from plotly.express to plot geographical data on a map.
import geopandas as gpd
import plotly.express as px
fig = px.scatter_geo(gdf,
lat = 'latitude',
lon = 'longitude',
geojson='geometry',
scope='europe',
animation_frame = 'year')
fig.show()
How can I archive that the map is centered to only one country, in my case Germany? The parameter scope accepted only continents. There are two more parameters, center and fitbounds, that sounds useful, but I don't understand to fill in the right value.
center (dict) – Dict keys are 'lat' and 'lon' Sets the center point of the map.
fitbounds (str (default False).) – One of False, locations or geojson.
Dummie data:
geometry latitude longitude value year
0 POINT (13.72740 51.05570) 51.0557 13.7274 35.55 1838
1 POINT (13.72740 51.05570) 51.0557 13.7274 35.15 1842
