3

I am trying to plot the KSA map through plotly using Google Colab, no error but the map is not shown. Any advice would be appreciated, here is the code

import pandas as pd
import plotly.offline as py_offline
import plotly.graph_objs as go
py_offline.init_notebook_mode()
import pandas as pd
cases = []
cases.append(go.Scattergeo(
    lon = [46.720798, 46.739295],
    lat = [24.694691, 24.703821],
    text = [0.242, 0.285]
) )

layout = go.Layout(
    title="Saudi Arabia",
    geo = dict(
        resolution = 50,
        scope = 'asia',
        showframe = False,
        showcoastlines = True,
        showland = True,
        landcolor = "rgb(229, 229, 229)",
        countrycolor = "rgb(255, 255, 255)" ,
        coastlinecolor = "rgb(255, 255, 255)",
        projection = dict(
            type = 'mercator',
            scale=3
        ),
        center = dict(
            lon=46,
            lat=24
        )
    )
)

fig = go.Figure(layout=layout, data=cases)
py_offline.iplot(fig, validate=False, filename='Saudi Arabia')
Mohana
  • 459
  • 3
  • 13

0 Answers0