Hello,
This is my first post, Iām not sure of the format of topics on this site just yet.
Iām working in a completely offline environment utilizing Plotly with Python to make some plots. I have come across an issue regarding Map Plots. I have made a Scattergeo plot and the figure never seems to render.
Hereās some example code:
import plotly
import plotly.graph_objects as go
import numpy as np
import pandas as pd
from plotly.offline import plot
fig = go.Figure()
size = 50
#Data Creation
d = {'Lat':np.random.randint(90,120,size),
'Lon':np.random.randint(-180,180,size),
'colorcode':np.random.randint(-40,20,size)}
df = pd.DataFrame(d)
fig.add_trace(go.Scattergeo(mode = "markers+lines",lon = df['Lon'],lat = df['Lat'],marker = {'size': 10,'color':df['colorcode'],'colorscale':'jet','colorbar_thickness':20}))
fig.update_layout( geo = dict(
showland = True,
showcountries = True,
showocean = True,
countrywidth = 0.5,
landcolor = 'rgb(230, 145, 56)',
lakecolor = 'rgb(0, 255, 255)',
oceancolor = 'rgb(0, 255, 255)',
projection = dict(
type = 'orthographic',
),
lonaxis = dict(
showgrid = True,
gridcolor = 'rgb(102, 102, 102)',
gridwidth = 0.5
),
lataxis = dict(
showgrid = True,
gridcolor = 'rgb(102, 102, 102)',
gridwidth = 0.5
)
)
)
plot(fig)
Whenever I run this code, the figure attempts to pop up in a browser, but the figure never renders. I have noticed that there are references to āhttp://www.w3.orgā in the HTML. Is there a way to make these plots with complete offline support?
If scattergeo is not the way to go, then is there another plot that I can do to achieve the same result?
I have tried to create other plot types, and they seem to work fine.
Any suggestions would be greatly appreciated.