Penguni commited on
Commit
b7ae97f
·
verified ·
1 Parent(s): 655972b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -14
app.py CHANGED
@@ -208,21 +208,36 @@ def plot_global_map():
208
  df_grouped['log_total_films'] = np.log1p(df_grouped['total_films'])
209
 
210
  # Create a choropleth map with the log-transformed data
211
- fig = px.choropleth(df_grouped, locations='region', locationmode='country names',
212
- color='log_total_films', hover_name='region',
213
- color_continuous_scale='solar', # Change the color scheme here
214
- labels={'log_total_films': 'Total Films'})
215
-
 
 
 
 
 
216
  # Update layout of the map
217
- fig.update_layout(title='Total Films by Country',
218
- geo=dict(showframe=False, showcoastlines=False,
219
- projection_type='equirectangular'),
220
- plot_bgcolor='black', # Set plot background color to black
221
- paper_bgcolor='black', # Set paper background color to black
222
- font=dict(color='white') # Set text color to white
223
- )
224
-
225
- return fig
 
 
 
 
 
 
 
 
 
 
226
 
227
 
228
  # Function to fetch summary info
 
208
  df_grouped['log_total_films'] = np.log1p(df_grouped['total_films'])
209
 
210
  # Create a choropleth map with the log-transformed data
211
+ fig = px.choropleth(
212
+ df_grouped,
213
+ locations='region',
214
+ locationmode='country names',
215
+ color='log_total_films',
216
+ hover_name='region',
217
+ color_continuous_scale='solar', # Change the color scheme here
218
+ labels={'log_total_films': 'Total Films'}
219
+ )
220
+
221
  # Update layout of the map
222
+ fig.update_layout(
223
+ title={
224
+ 'text': 'Total Films by Country',
225
+ 'x': 0.5, # Center the title
226
+ 'xanchor': 'center',
227
+ 'yanchor': 'top',
228
+ 'font': {'color': 'white'} # Set title text color to white
229
+ },
230
+ geo=dict(
231
+ showframe=False,
232
+ showcoastlines=False,
233
+ projection_type='orthographic' # Change projection to orthographic for a globe appearance
234
+ ),
235
+ plot_bgcolor='black', # Set plot background color to black
236
+ paper_bgcolor='black', # Set paper background color to black
237
+ font=dict(color='white') # Set text color to white
238
+ )
239
+
240
+ fig.show()
241
 
242
 
243
  # Function to fetch summary info