Line_mapbox as subplot

Hello! I recently tried creating a subplot so I could position all my plots the way I wanted. The only thing that’s giving me trouble is the line_mapbox plot, which, given the following code, complains “Invalid element(s) received for the ‘data’ property”:

csv = pd.read_csv ("trajectory.csv")
map = px.line_mapbox (csv, lat = "lat", lon = "lon", zoom = 3, height = 500,
                          hover_data = ["time", "speed"],
                          color_discrete_sequence = ["crimson"])
token = open (".mapbox_token").read ()
map.update_layout (mapbox_style = "satellite-streets",
                       mapbox_accesstoken = token,
                       mapbox_zoom = 4, mapbox_center_lat = 41,
                       margin = {"r":0,"t":0,"l":0,"b":0},
                       uirevision = 1)
fig.add_trace(map, row=1, col=2)

The type of the subplot is set to “mapbox” as the documentation suggests. I don’t understand the error or how to solve it, nor can I find any examples of line_mapbox being used as a subplot. The closest I found is this post. I tried replacing the line “fig.add_trace(map, row=1, col=2)” with “fig.add_trace(map[‘data’][0], row=1, col=2)” and while the errors were gone, the mapbox didn’t display at all. I’ve used the exact same mapbox on its own (without being a part of a subplot) and it works fine. Any idea what might I be missing? Thanks!

According to this, plotly express only supports facet and marginal distribution plots to be used as subplots. So the best solution I found is the one proposed in this post, using custom CSS.