Skip to content

Commit ee3bcfc

Browse files
committed
fix: update figure layout to use 'constrained' for better visualization in examples
1 parent 87fdeff commit ee3bcfc

5 files changed

Lines changed: 5 additions & 15 deletions

File tree

examples/geo/ex_geodetic.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
# Visualization: Common Workflows
237237
# --------------------------------
238238

239-
fig = matplotlib.pyplot.figure(figsize=(16, 10))
239+
fig = matplotlib.pyplot.figure(figsize=(16, 10), layout="constrained")
240240

241241
# Plot 1: Study area and cities
242242
ax1 = fig.add_subplot(2, 3, 1, projection=cartopy.crs.PlateCarree())
@@ -430,8 +430,6 @@
430430
ax6.set_xlabel("Longitude (°)")
431431
ax6.set_ylabel("Latitude (°)")
432432

433-
matplotlib.pyplot.tight_layout()
434-
435433
# %%
436434
# Next Steps
437435
# ----------

examples/geo/ex_geometry_advanced.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@
404404
# Visualization: Advanced Features
405405
# ---------------------------------
406406

407-
fig = matplotlib.pyplot.figure(figsize=(16, 12))
407+
fig = matplotlib.pyplot.figure(figsize=(16, 12), layout="constrained")
408408

409409
# Plot 1: Line interpolation waypoints
410410
ax1 = fig.add_subplot(2, 3, 1, projection=cartopy.crs.PlateCarree())
@@ -612,6 +612,4 @@
612612
ax6.grid(True, alpha=0.3)
613613
ax6.set_yscale("log")
614614

615-
matplotlib.pyplot.tight_layout()
616-
617615
# %%

examples/geo/ex_geometry_primitives.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@
429429
# ---------------------------------
430430
# Let's visualize some of the primitives we've created
431431

432-
fig = matplotlib.pyplot.figure(figsize=(15, 10))
432+
fig = matplotlib.pyplot.figure(figsize=(15, 10), layout="constrained")
433433

434434
# Plot 1: Points and MultiPoint
435435
ax1 = fig.add_subplot(2, 3, 1, projection=cartopy.crs.PlateCarree())
@@ -546,6 +546,4 @@
546546
ax6.set_title("MultiLineString")
547547
ax6.legend()
548548

549-
matplotlib.pyplot.tight_layout()
550-
551549
# %%

examples/geo/ex_geometry_satellite.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def create_orbit_track(
315315
# Visualization: Satellite Track Crossovers
316316
# ------------------------------------------
317317

318-
fig = matplotlib.pyplot.figure(figsize=(16, 12))
318+
fig = matplotlib.pyplot.figure(figsize=(16, 12), layout="constrained")
319319

320320
# Plot 1: Basic crossover detection
321321
ax1 = fig.add_subplot(2, 3, 1, projection=cartopy.crs.PlateCarree())
@@ -550,12 +550,10 @@ def create_orbit_track(
550550
ax6.set_title("Crossover Density Map")
551551
ax6.grid(True, alpha=0.3)
552552

553-
matplotlib.pyplot.tight_layout()
554553
matplotlib.pyplot.suptitle(
555554
"Satellite Geometric Operations",
556555
fontsize=16,
557556
fontweight="bold",
558-
y=1.00,
559557
)
560558

561559
# %%

examples/geo/ex_geometry_spatial_predicates.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@
443443
# Visualization: Spatial Predicates in Action
444444
# --------------------------------------------
445445

446-
fig = matplotlib.pyplot.figure(figsize=(16, 12))
446+
fig = matplotlib.pyplot.figure(figsize=(16, 12), layout="constrained")
447447

448448
# Plot 1: Basic Predicates (Within, Covered By, Intersects)
449449
ax1 = fig.add_subplot(2, 3, 1)
@@ -622,12 +622,10 @@
622622
ax6.legend()
623623
ax6.set_title("Gulf of Mexico Selection")
624624

625-
matplotlib.pyplot.tight_layout()
626625
matplotlib.pyplot.suptitle(
627626
"Spatial Predicates and Relationships",
628627
fontsize=16,
629628
fontweight="bold",
630-
y=1.00,
631629
)
632630

633631
# %%

0 commit comments

Comments
 (0)