Scatter Plots on Mapbox example - Multiple Markers

In this example:

Scatter Plots on Mapbox example - Multiple Markers

The map renders but the multiple additional markers do not.

Running in a Jupyter notebook on OSX H.S., all the latest libs (Plot.ly 3.7.0)

2019-04-01_13-54-38

Hi @thoughtsociety,

How are you displaying the figure (online mode, offline mode, FigureWidget, etc.). When I copy paste the documentation example directly (which displays in online mode) I do see all of the markers. Even if it’s from the documentation, a full example is helpful :slightly_smiling_face:

-Jon

@jmmease I am running in offline mode.

here is the example slightly modified so it works offline in notebook:

import plotly.plotly as py
import plotly.graph_objs as go
from plotly.offline import init_notebook_mode, iplot

plotly.offline.init_notebook_mode(connected=True)   # initiate notebook for offline plot
# this stuff works for avoiding plotly online 

# mapbox_access_token = 'ADD_YOUR_TOKEN_HERE'  - I have added a valid token and it does work

mapbox_access_token = 'pk.eyJ1IjoidGhvdWdodHNvY2lldHkiLCJhIjoiY2p0…

data = [
    go.Scattermapbox(
        lat=['38.91427','38.91538','38.91458',
             '38.92239','38.93222','38.90842',
             '38.91931','38.93260','38.91368',
             '38.88516','38.921894','38.93206',
             '38.91275'],
        lon=['-77.02827','-77.02013','-77.03155',
             '-77.04227','-77.02854','-77.02419',
             '-77.02518','-77.03304','-77.04509',
             '-76.99656','-77.042438','-77.02821',
             '-77.01239'],
        mode='markers',
        marker=go.scattermapbox.Marker(
            size=9
        ),
        text=["The coffee bar","Bistro Bohem","Black Cat",
             "Snap","Columbia Heights Coffee","Azi's Cafe",
             "Blind Dog Cafe","Le Caprice","Filter",
             "Peregrine","Tryst","The Coupe",
             "Big Bear Cafe"],
    )
]

layout = go.Layout(
    autosize=True,
    hovermode='closest',
    mapbox=go.layout.Mapbox(
        accesstoken=mapbox_access_token,
        bearing=0,
        center=go.layout.mapbox.Center(
            lat=38.92,
            lon=-77.07
        ),
        pitch=0,
        zoom=10
    ),
)

fig = go.Figure(data=data, layout=layout)

iplot(fig) # running in offline mode  -  

# py.iplot(fig, filename='Multiple Mapbox')

Thanks for including the example. When I run this, here’s what I get

import plotly.plotly as py
import plotly.graph_objs as go
from plotly.offline import init_notebook_mode, iplot

init_notebook_mode(connected=True)   # initiate notebook for offline plot
# this stuff works for avoiding plotly online 

# mapbox_access_token = 'pk...'

data = [
    go.Scattermapbox(
        lat=['38.91427','38.91538','38.91458',
             '38.92239','38.93222','38.90842',
             '38.91931','38.93260','38.91368',
             '38.88516','38.921894','38.93206',
             '38.91275'],
        lon=['-77.02827','-77.02013','-77.03155',
             '-77.04227','-77.02854','-77.02419',
             '-77.02518','-77.03304','-77.04509',
             '-76.99656','-77.042438','-77.02821',
             '-77.01239'],
        mode='markers',
        marker=go.scattermapbox.Marker(
            size=9
        ),
        text=["The coffee bar","Bistro Bohem","Black Cat",
             "Snap","Columbia Heights Coffee","Azi's Cafe",
             "Blind Dog Cafe","Le Caprice","Filter",
             "Peregrine","Tryst","The Coupe",
             "Big Bear Cafe"],
    )
]

layout = go.Layout(
    autosize=True,
    hovermode='closest',
    mapbox=go.layout.Mapbox(
        accesstoken=mapbox_access_token,
        bearing=0,
        center=go.layout.mapbox.Center(
            lat=38.92,
            lon=-77.07
        ),
        pitch=0,
        zoom=10
    ),
)

fig = go.Figure(data=data, layout=layout)

iplot(fig) # running in offline mode  -  

Can you include a screenshot of what you see?
-Jon