Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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(
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
|
|
|
|
|
|
|
|
|
|
216 |
# Update layout of the map
|
217 |
-
fig.update_layout(
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|