Hi,
I tried to have dropdown buttons for different geo projection_style.
But somehow it is not working correctly. Do you know how to do that?
fig = go.Figure()
fig.add_trace(go.Scattergeo())
# fig.add_trace(go.Scattergeo(lat = gDec,
# lon = gAs,
# marker=dict(color=colorlist,size=2)))
fig.update_geos(
# projection_type="aitoff",
# projection_type="aitoff",
projection_type="orthographic",
lataxis_showgrid=True,
lonaxis_showgrid=True)
# Add dropdown
fig.update_layout(
updatemenus=[
dict(
buttons=list([
dict(
args=["type", "orthographic"],
label="orthographic",
method="restyle"
),
dict(
args=["type", "aitoff"],
label="aitoff",
method="restyle"
)
]),
direction="down",
pad={"r": 10, "t": 10},
showactive=True,
x=0.1,
xanchor="left",
y=1.1,
yanchor="top"
),
]
)
fig.update_layout(
template = "plotly_dark",
)
fwidth = 960
fheight = 600
fig.update_layout(
font = dict(family="Times New Roman, monospace",size=fontsize),
autosize=False,
width=fwidth,height=fheight,
margin=dict(l=80,r=80,b=80,t=100,pad=0))
config = {
'toImageButtonOptions': {
'format': 'jpeg', # one of png, svg, jpeg, webp
'filename': 'custom_image',
'width': fwidth,'height': fheight,
'scale':8 # Multiply title/legend/axis/canvas sizes by this factor
}}
fig.show(config=config)
Thanks,
Andy