OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to enlarge geographic map in Python/Plotly choropleth plot?

  • Thread starter Thread starter ryilkici
  • Start date Start date
R

ryilkici

Guest
I am making a choropleth plot with Plotly. But, the geographic map looking to small.

like that:

My code is here:

Code:
fig = px.choropleth(df,
                    geojson=geojson,
                    locations="Capitalize",
                    featureidkey="properties.name",
                    color="Scale",
                    hover_name='Capitalize',
                    hover_data=['Quantity'],
                    animation_frame="Period",
                    projection="mercator",)

fig.update_geos(fitbounds="locations", visible=False)
fig.update_layout(title_text = 'Product A',
                  autosize=True,
                  hovermode='closest',
                  title_x = 0.5,
                  margin={"r":0,"t":100,"l":0,"b":0},
                  geo=dict(showframe = False, showcoastlines = False))

width and height attributes are not making exactly what i want to do. I want to enlarge only geographic map. How can i do that in plotly?
<p>I am making a choropleth plot with Plotly. But, the geographic map looking to small.</p>
<p><a href="https://i.sstatic.net/5s4kS.png" rel="noreferrer">like that:</a></p>
<p>My code is here:</p>
<pre><code>fig = px.choropleth(df,
geojson=geojson,
locations="Capitalize",
featureidkey="properties.name",
color="Scale",
hover_name='Capitalize',
hover_data=['Quantity'],
animation_frame="Period",
projection="mercator",)

fig.update_geos(fitbounds="locations", visible=False)
fig.update_layout(title_text = 'Product A',
autosize=True,
hovermode='closest',
title_x = 0.5,
margin={"r":0,"t":100,"l":0,"b":0},
geo=dict(showframe = False, showcoastlines = False))
</code></pre>
<p>width and height attributes are not making exactly what i want to do. I want to enlarge only geographic map. How can i do that in plotly?</p>
 

Latest posts

A
Replies
0
Views
1
Alfredo Augusto Petri
A
Top