Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -302,7 +302,7 @@ def generate_main_analysis(start_year, start_month, end_year, end_month, enso_ph
|
|
302 |
|
303 |
return tracks_fig, wind_scatter, pressure_scatter, regression_fig, slopes_text
|
304 |
|
305 |
-
# Video animation function with
|
306 |
def categorize_typhoon_by_standard(wind_speed, standard):
|
307 |
if standard == 'taiwan':
|
308 |
wind_speed_ms = wind_speed * 0.514444
|
@@ -341,8 +341,8 @@ def generate_track_video(year, typhoon, standard):
|
|
341 |
lat_padding = max((max_lat - min_lat) * 0.3, 5)
|
342 |
lon_padding = max((max_lon - min_lon) * 0.3, 5)
|
343 |
|
344 |
-
# Set up the figure with
|
345 |
-
fig = plt.figure(figsize=(
|
346 |
ax = plt.axes([0.05, 0.05, 0.65, 0.9], projection=ccrs.PlateCarree()) # Map on left 65% of figure
|
347 |
ax.set_extent([min_lon - lon_padding, max_lon + lon_padding, min_lat - lat_padding, max_lat + lat_padding], crs=ccrs.PlateCarree())
|
348 |
|
|
|
302 |
|
303 |
return tracks_fig, wind_scatter, pressure_scatter, regression_fig, slopes_text
|
304 |
|
305 |
+
# Video animation function with adjusted scale
|
306 |
def categorize_typhoon_by_standard(wind_speed, standard):
|
307 |
if standard == 'taiwan':
|
308 |
wind_speed_ms = wind_speed * 0.514444
|
|
|
341 |
lat_padding = max((max_lat - min_lat) * 0.3, 5)
|
342 |
lon_padding = max((max_lon - min_lon) * 0.3, 5)
|
343 |
|
344 |
+
# Set up the figure with Gradio-friendly scale (1000x700 pixels at 100 DPI)
|
345 |
+
fig = plt.figure(figsize=(10, 7), dpi=100) # 10x7 inches = 1000x700 pixels
|
346 |
ax = plt.axes([0.05, 0.05, 0.65, 0.9], projection=ccrs.PlateCarree()) # Map on left 65% of figure
|
347 |
ax.set_extent([min_lon - lon_padding, max_lon + lon_padding, min_lat - lat_padding, max_lat + lat_padding], crs=ccrs.PlateCarree())
|
348 |
|