Stereonet plots for structural geology using matplotlib. Create lower-hemisphere
stereographic projections for orientation data. Use when Claude needs to: (1) Create
stereonet plots for structural data, (2) Plot planes as great circles or poles,
(3) Plot lineations with trend/plunge, (4) Generate density contours for orientations,
(5) Calculate mean orientations and statistics, (6) Analyze fold axes with pi-diagrams,
(7) Convert between strike/dip and trend/plunge formats.
Instrucciones de origen · Vista previa de solo lectura
name
mplstereonet
description
Stereonet plots for structural geology using matplotlib. Create lower-hemisphere
stereographic projections for orientation data. Use when Claude needs to: (1) Create
stereonet plots for structural data, (2) Plot planes as great circles or poles,
(3) Plot lineations with trend/plunge, (4) Generate density contours for orientations,
(5) Calculate mean orientations and statistics, (6) Analyze fold axes with pi-diagrams,
(7) Convert between strike/dip and trend/plunge formats.
# Fit best-fit plane (girdle)
mean_strike, mean_dip = mplstereonet.fit_girdle(strikes, dips)
# Or calculate mean pole for clustered data
lon, lat = mplstereonet.pole(strikes, dips)
mean_lon, mean_lat = mplstereonet.find_mean_vector(lon, lat)
mean_s, mean_d = mplstereonet.pole2strike(mean_lon, mean_lat)
Pi-Diagram (Fold Axis)
# Bedding measurements around a fold
strikes = np.array([20, 35, 50, 70, 90, 110, 130, 150, 165, 180])
dips = np.array([45, 40, 35, 30, 25, 30, 35, 40, 45, 50])
fig, ax = mplstereonet.subplots()
ax.pole(strikes, dips, 'ko', markersize=6)
# Fit girdle to poles - fold axis is pole to girdle
girdle_strike, girdle_dip = mplstereonet.fit_girdle(strikes, dips)
ax.plane(girdle_strike, girdle_dip, 'r-', linewidth=2)
fold_trend, fold_plunge = mplstereonet.pole(girdle_strike, girdle_dip)
ax.line(fold_trend, fold_plunge, 'r^', markersize=12, label='Fold axis')
ax.grid()
ax.legend()
Use mplstereonet when you need programmatic stereonet generation integrated with
matplotlib, batch processing of orientation datasets, or reproducible structural plots
for publications.
Consider alternatives when you need interactive 3D visualization of orientations
(use apsg), a GUI for teaching or quick inspection (use JTOPO), or advanced tensor
statistics beyond what mplstereonet provides.
Common Workflows
Analyze bedding orientations and determine fold axis
Load strike/dip measurements from CSV or array
Create stereonet with mplstereonet.subplots()
Plot poles to bedding with ax.pole(strikes, dips)
Generate density contours with ax.density_contourf()
Fit girdle to poles with mplstereonet.fit_girdle()
Calculate fold axis as pole to girdle with mplstereonet.pole()