简体   繁体   中英

Plotly Mapbox images showing blank with blue background (Jupyter Notebook)

I am running the following code to plot points against a city backdrop using Mapbox within Plotly in a Jupyter Notebook, but the plot does not show up, I just get a blue background.

I suspect that I am not using the token correctly?

import plotly.express as px

MBToken = 'pk.[mypublickey]'
px.set_mapbox_access_token(MBToken)

fig = px.scatter_mapbox(dfMaster.dropna()
                        , lat="latitude"
                        , lon="longitude"
                        , color="nta"
                        , size="count_of_testers"
                        #, color_continuous_scale=px.colors.cyclical.IceFire
                        #, size_max=15
                        #, zoom=10
                       )
fig.show()

#fig = px.scatter(x='latitude',y='longitude',data_frame=df)
#fig.show()

Running that gives me: 在此处输入图片说明

It does not appear to be a Plotly issue, the commented out code creates a scatter plot (although that has the same blue background, but the points show)

Some other posts have pointed to Jupyter offline mode being the possible culprit, but adding this did not resolve

import plotly.offline as pyo
pyo.init_notebook_mode()

Additionally, tried starting up the Jupyter notebook with a higher data rate limit as suggested, but no luck there either

这最终是一个无提示的数据完整性错误,因为size字段是一个字符串,需要转换为数字

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM