Hello,
I have mutliple dataframes with different data which I plot using Plotly Go Scattermapbox. Everything works fine. I add the dataframes with fig.add_trace
and enter also customdata in there to display it in the hover.
Now I have a new dataframe which has lat, lon, name and also some values showing me the amount of prices and I want to have a bubbles on the map indicating where the price is high or low with big or small bubbles. Is this possible to add as a additional trace on my existing map?
What I currently have is something like this:
import plotly.graph_objects as go
token = open(".mapbox_token").read() # you need your own token
fig = go.Figure(go.Scattermapbox(
mode = "markers",
lon = df1['lon'],
lat = df1['lat'],
marker = {'size': 13},
text = df1['name']
fig.add_trace(go.Scattermapbox(
mode = "markers",
lon = df2['lon'],
lat = df2['lat'],
marker = {'size': 13},
text = df2['name']
fig.update_layout(
mapbox = {
'accesstoken': token,
'style': "streets", 'zoom': 0.7},
showlegend = False)
fig.show()