Hello Everyone, I’m new in plotply and a hobby programmer. I’m wiritng a simple script to create a map of a a few dots, each representing nearby villages. Nothing fancy. I google for tips a lot.
Unfortunately I was not able to solve one issue - my map always pops up as a square and I’d love it to pop up as a rectangle with longer bottom side.
I played with .update_layout autosize, hight, width, margins but it didn’t help.
fig.update_layout(
autosize=True,
height=970,
geo=dict(
center=dict(lat=szer,lon=dlug),
scope=‘europe’,
projection_scale=proj),
)
Hi @MoniaJ ,
I assume you use go.Scattergeo
.
Have you play around with lonaxis
and lataxis
attributes ?. These attribute is in the geo
attribute.
These are for limiting range of the latitude axis
(x axis) and longitude axis
(y axis) of the map.
if you want to control the size of paper use width
and height
.
Suppose you want to the paper size 800x600 and the coordinate of Java island (it suppose displayed as rectangle)
fig.update_layout(
title=TITLE,
height=600,
width=800,
geo=dict(
lonaxis=dict(range=[105.27, 114.87]),
lataxis=dict(range=[-9.25,-5.65])
),
showlegend=False
)
1 Like
Hello, this perfectly solved my issue Many thanks!