Black Lives Matter. Please consider donating to Black Girls Code today.

Not able to create a heatmap on a city map uing Mapbox

Hello community!
I was exploring one dataset on Kaggle (NYC Fare Prediction and I wanted to plot a heatmap of fares using mapbox.

data = [
go.Scattermapbox(
lat = train['dropoff_latitude'],
lon = train['dropoff_longitude'],
mode = 'markers',
marker = dict(
    size = 4, 
    color = train['fare_amount'],
    opacity = 0.8
    ),
    )]
layout = go.Layout(autosize=False,
               mapbox= dict(accesstoken="pk.eyJ1IjoiYWJoaTM0NTMiLCJhIjoiY2pucWQ4NDlrMDY3NTNrbndjczZnNnZ4eCJ9.EJX2rmBc8eeXtuJ_ouagpQ",
                            bearing=10,
                            pitch=60,
                            zoom=13,
                            center= dict(
                                     lat=40.721319,
                                     lon=-73.987130),
                            style= "mapbox://styles/abhi3453/cjnqed0x70z5i2ro24fyy53ak"),
                width=900,
                height=600, title = "Drop off locations in Newyork")

fig = dict(data = data, layout = layout)
iplot(fig)

It would be great if you could help me with where I am going wrong

Hi @abhi3453,

Unfortunately this isn’t supported right now. Here’s an open issue on it https://github.com/plotly/plotly.js/issues/3110.

-Jon