Types of gaits and definition and phase
| Phase | % of Gait Cycle | Description |
|---|---|---|
| Stance Phase | 60% | Weight-bearing; foot on the ground |
| Swing Phase | 40% | Non-weight-bearing; foot off the ground |
| Sub-phase | Starts | Ends |
|---|---|---|
| 1. Initial Contact (IC) | The instant the reference foot contacts the ground | - |
| 2. Loading Response (LR) | IC of the reference foot | Initial swing of the contralateral foot |
| 3. Midstance (MSt) | Initial swing of the advancing foot | Body's center of gravity is directly over the supporting forefoot |
| 4. Terminal Stance (TSt) | Heel rise | IC of the contralateral (advancing) foot |
| 5. Preswing (PSw) | IC of the contralateral limb | Reference foot lifts off the ground |
| Sub-phase | Starts | Ends |
|---|---|---|
| 1. Initial Swing (ISw) | Reference foot leaves the ground | Swinging foot is opposite the stance foot |
| 2. Midswing | Swinging foot opposite stance foot | Tibia of swinging limb is perpendicular/vertical to the ground |
| 3. Terminal Swing (TSw) | Tibia is vertical/perpendicular | Foot makes Initial Contact with the ground |
| Gait Type | Lesion Location | Key Feature |
|---|---|---|
| Spastic hemiparetic | Unilateral corticospinal | Circumduction, arm flexion |
| Scissors (spastic paraparetic) | Bilateral cord | Leg adduction, toe catching |
| Cerebellar ataxic | Cerebellum | Wide base, Romberg - |
| Sensory ataxic | Posterior columns/PNS | Wide base, Romberg + |
| Parkinsonian | Basal ganglia | Shuffle, festination, freeze |
| Steppage | Peroneal nerve/foot drop | High-step, foot slap |
| Waddling | Hip abductors | Trunk sway, Trendelenburg |
| Antalgic | Pain (joints/bones) | Short stance on painful side |
| Choreic | Basal ganglia | Dancing, lurching |
| Dystonic | BG/corticospinal | Bizarre postures, hip flexion |
| Functional | Psychiatric | Variable, improves distracted |
Create a visual diagram or poster comparing abnormal gait patterns
A detailed medical education poster titled "Abnormal Gait Patterns" showing a comparison chart of different pathological gaits. The poster has a clean clinical style with a dark navy blue background and white/colored text. It includes illustrated stick figures or silhouettes demonstrating each gait type arranged in a grid layout. Each gait type has: the name in bold, the lesion location, and 2-3 key features. The gaits shown are: 1) Spastic Hemiparetic Gait - figure with arm flexed and leg circumducting, 2) Scissors Gait - figure with legs crossing/adducted, 3) Cerebellar Ataxic Gait - figure wide-based stumbling, 4) Sensory Ataxic Gait - figure high-stepping wide-based, 5) Parkinsonian Gait - figure stooped with small shuffling steps, 6) Steppage Gait - figure with high knee lift foot drop, 7) Waddling/Trendelenburg Gait - figure swaying side to side, 8) Antalgic Gait - figure leaning away from one side. Each section uses a different accent color. Medical school quality poster, clear labels, professional anatomy illustration style.
404 Not Found. {'message': '{\n "error": {\n "code": 404,\n "message": "Publisher model `projects/engaged-beaker-474810-u2/locations/global/publishers/google/models/gemini-3-pro-image-preview` was not found or your project does not have access to it. Ensure you are using a valid model name and that the model is available in the specified region. For more information, see: https://docs.cloud.google.com/gemini-enterprise-agent-platform/resources/locations.",\n "status": "NOT_FOUND"\n }\n}\n', 'status': 'Not Found'}
We encountered an error while processing your request. Please try again or reach out to us for help.
Create a visual diagram or poster comparing abnormal gait patterns
mkdir -p /tmp/workspace/gait-poster && ls /tmp/workspace/gait-poster/
~/gait-poster/gait_poster.py
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.patches import FancyBboxPatch, Circle, FancyArrowPatch
import matplotlib.patheffects as pe
import numpy as np
# ── canvas ──────────────────────────────────────────────────────────────────
fig = plt.figure(figsize=(24, 32), facecolor='#0d1b2a')
fig.patch.set_facecolor('#0d1b2a')
# ── helper: draw a simple stick figure ──────────────────────────────────────
def stick_figure(ax, cx, cy, scale=1.0,
head_color='#ffffff',
body_color='#ffffff',
lw=2.5,
# offsets relative to centre (cx,cy) in axes coords
head_dy=0.10, # head above hip
torso_lean=0.0, # lateral lean of torso
torso_bend=0.0, # forward stoop (reduces torso height)
r_arm_angle=45, # degrees below horizontal
l_arm_angle=135,
r_knee_x=0.03, r_knee_y=-0.055,
l_knee_x=-0.03, l_knee_y=-0.055,
r_foot_x=0.05, r_foot_y=-0.10,
l_foot_x=-0.05, l_foot_y=-0.10,
):
s = scale
# hip position
hx, hy = cx, cy
# torso top (shoulder)
sx = hx + torso_lean * s
sy = hy + (0.07 - torso_bend) * s
# head
head = Circle((sx, sy + 0.04 * s), 0.022 * s, color=head_color, zorder=5, transform=ax.transAxes)
ax.add_patch(head)
# torso
ax.plot([hx, sx], [hy, sy], color=body_color, lw=lw, solid_capstyle='round', transform=ax.transAxes, zorder=5)
# arms
arm_len = 0.05 * s
for angle, sign in [(r_arm_angle, 1), (l_arm_angle, -1)]:
rad = np.radians(angle)
ax.plot([sx, sx + arm_len * np.cos(rad)],
[sy, sy - arm_len * np.sin(rad)],
color=body_color, lw=lw * 0.9, solid_capstyle='round',
transform=ax.transAxes, zorder=5)
# legs
ax.plot([hx, hx + r_knee_x * s, hx + r_foot_x * s],
[hy, hy + r_knee_y * s, hy + r_foot_y * s],
color=body_color, lw=lw, solid_capstyle='round', transform=ax.transAxes, zorder=5)
ax.plot([hx, hx + l_knee_x * s, hx + l_foot_x * s],
[hy, hy + l_knee_y * s, hy + l_foot_y * s],
color=body_color, lw=lw, solid_capstyle='round', transform=ax.transAxes, zorder=5)
# ── colour palette ────────────────────────────────────────────────────────────
COLORS = {
'spastic_hemi': '#e74c3c',
'scissors': '#e67e22',
'cerebellar': '#f1c40f',
'sensory': '#2ecc71',
'parkinsonian': '#1abc9c',
'steppage': '#3498db',
'waddling': '#9b59b6',
'antalgic': '#e91e8c',
'choreic': '#ff6b6b',
'dystonic': '#fd9644',
'functional': '#a29bfe',
}
BG_CARD = '#112233'
TEXT_MAIN = '#ffffff'
TEXT_SUB = '#cfd8dc'
TEXT_DIM = '#90a4ae'
ACCENT = '#00bcd4'
# ═══════════════════════════════════════════════════════════════════════════
# TITLE AREA
# ═══════════════════════════════════════════════════════════════════════════
title_ax = fig.add_axes([0.0, 0.93, 1.0, 0.07])
title_ax.set_facecolor('#0a3d62')
title_ax.set_xlim(0, 1); title_ax.set_ylim(0, 1)
title_ax.axis('off')
title_ax.text(0.5, 0.62, 'ABNORMAL GAIT PATTERNS', ha='center', va='center',
fontsize=38, fontweight='bold', color='#ffffff',
fontfamily='DejaVu Sans',
path_effects=[pe.withStroke(linewidth=4, foreground='#0a3d62')])
title_ax.text(0.5, 0.18, 'Clinical Comparison • Lesion Location • Key Features • Gait Cycle Context',
ha='center', va='center', fontsize=14, color='#90caf9')
# ═══════════════════════════════════════════════════════════════════════════
# GAIT CYCLE BANNER (top strip below title)
# ═══════════════════════════════════════════════════════════════════════════
gc_ax = fig.add_axes([0.02, 0.895, 0.96, 0.032])
gc_ax.set_facecolor('#1a2a3a')
gc_ax.set_xlim(0, 100); gc_ax.set_ylim(0, 1)
gc_ax.axis('off')
# Stance bar (60%)
gc_ax.add_patch(FancyBboxPatch((0.5, 0.15), 59, 0.7, boxstyle='round,pad=0.3',
facecolor='#1565c0', edgecolor='#42a5f5', lw=1.2))
gc_ax.text(30, 0.5, 'STANCE PHASE 60% [IC → LR → Midstance → Terminal Stance → Preswing]',
ha='center', va='center', fontsize=9, color='#ffffff', fontweight='bold')
# Swing bar (40%)
gc_ax.add_patch(FancyBboxPatch((60.5, 0.15), 39, 0.7, boxstyle='round,pad=0.3',
facecolor='#2e7d32', edgecolor='#66bb6a', lw=1.2))
gc_ax.text(80, 0.5, 'SWING PHASE 40% [Initial Swing → Midswing → Terminal Swing]',
ha='center', va='center', fontsize=9, color='#ffffff', fontweight='bold')
# ═══════════════════════════════════════════════════════════════════════════
# DATA: each card
# ═══════════════════════════════════════════════════════════════════════════
gaits = [
{
'name': '1. Spastic\nHemiparetic Gait',
'color': COLORS['spastic_hemi'],
'lesion': 'Unilateral Corticospinal Tract\n(Brain / Cervical Cord)',
'features': [
'Arm: adducted, flexed at elbow, pronated',
'Leg: extended at knee, plantarflexed',
'Circumduction of paretic leg (hip swings out)',
'Reduced arm swing on affected side',
'Shoe wear on toe & outer border',
],
'phase': 'Abnormal swing phase - circumduction replaces normal flex',
'fig_params': dict(torso_lean=0.015, r_arm_angle=20, l_arm_angle=130,
r_knee_x=0.04, r_knee_y=-0.045,
r_foot_x=0.07, r_foot_y=-0.095,
l_knee_x=-0.025, l_knee_y=-0.055,
l_foot_x=-0.04, l_foot_y=-0.10),
},
{
'name': '2. Scissors Gait\n(Spastic Paraparesis)',
'color': COLORS['scissors'],
'lesion': 'Bilateral Corticospinal Tracts\n(Spinal Cord)',
'features': [
'Both legs stiffly extended at knees',
'Plantarflexion + ankle inversion bilaterally',
'Strong adduction - legs cross ("scissors")',
'Toes catch the floor each step',
'Slow, laboured, dragging gait',
],
'phase': 'Reduced swing phase; failed ground clearance',
'fig_params': dict(torso_lean=0.0,
r_knee_x=0.01, r_knee_y=-0.045,
r_foot_x=0.0, r_foot_y=-0.09,
l_knee_x=-0.01, l_knee_y=-0.045,
l_foot_x=0.0, l_foot_y=-0.09),
},
{
'name': '3. Cerebellar\nAtaxic Gait',
'color': COLORS['cerebellar'],
'lesion': 'Cerebellum / Brainstem',
'features': [
'Wide-based stance (increased base of support)',
'Lurching, staggering, irregular steps',
'Dysmetria - steps vary in length & direction',
'Romberg sign ABSENT (eye closure minor effect)',
'Worsened on narrow base / heel-to-toe walking',
],
'phase': 'Irregular step length & timing in both phases',
'fig_params': dict(torso_lean=0.02,
r_knee_x=0.055, r_knee_y=-0.05,
r_foot_x=0.075, r_foot_y=-0.10,
l_knee_x=-0.055, l_knee_y=-0.05,
l_foot_x=-0.07, l_foot_y=-0.095),
},
{
'name': '4. Sensory\nAtaxic Gait',
'color': COLORS['sensory'],
'lesion': 'Posterior Columns / Peripheral Nerve\n(Proprioception Loss)',
'features': [
'Wide-based, high-stepping "stomping" gait',
'Foot slapped onto ground to confirm contact',
'Patient watches floor to compensate',
'Romberg sign PRESENT (greatly worsened eyes shut)',
'Causes: subacute combined degeneration, tabes',
],
'phase': 'Exaggerated IC; relies on visual feedback',
'fig_params': dict(
r_knee_x=0.035, r_knee_y=-0.025,
r_foot_x=0.05, r_foot_y=-0.10,
l_knee_x=-0.04, l_knee_y=-0.055,
l_foot_x=-0.055, l_foot_y=-0.10),
},
{
'name': '5. Parkinsonian\nGait',
'color': COLORS['parkinsonian'],
'lesion': 'Basal Ganglia\n(Substantia Nigra - Dopamine)',
'features': [
'Stooped posture, flexion of neck/trunk/hips',
'Shuffling small steps, reduced arm swing',
'Festination - rapid steps to prevent falling',
'Freezing episodes - inability to initiate steps',
'Retropulsion / Propulsion to regain balance',
],
'phase': 'Short stride; reduced swing; festination',
'fig_params': dict(torso_lean=0.0, torso_bend=0.025,
r_arm_angle=60, l_arm_angle=120,
r_knee_x=0.015, r_knee_y=-0.04,
r_foot_x=0.02, r_foot_y=-0.085,
l_knee_x=-0.015, l_knee_y=-0.04,
l_foot_x=-0.02, l_foot_y=-0.085),
},
{
'name': '6. Steppage Gait\n(Foot Drop)',
'color': COLORS['steppage'],
'lesion': 'Peroneal Nerve Palsy /\nDistal Motor Neuropathy',
'features': [
'Excessive hip & knee flexion during swing',
'"High-stepping" to clear dropped foot',
'Foot slap at Initial Contact',
'Cannot heel-strike normally',
'Causes: common peroneal nerve, CMT, ALS',
],
'phase': 'Exaggerated swing phase flexion for clearance',
'fig_params': dict(
r_knee_x=0.03, r_knee_y=-0.025,
r_foot_x=0.035, r_foot_y=-0.10,
l_knee_x=-0.03, l_knee_y=-0.055,
l_foot_x=-0.045, l_foot_y=-0.10),
},
{
'name': '7. Waddling Gait\n(Trendelenburg)',
'color': COLORS['waddling'],
'lesion': 'Hip Abductors (Gluteus Medius)\nProximal Myopathy',
'features': [
'Pelvis drops on non-weight-bearing side',
'Trunk shifts laterally toward weight-bearing leg',
'Exaggerated side-to-side seesaw trunk sway',
'Bilateral: waddling duck-like appearance',
'Causes: muscular dystrophy, hip OA, coxa vara',
],
'phase': 'Abnormal midstance - pelvic drop ipsilateral side',
'fig_params': dict(torso_lean=0.025,
r_knee_x=0.03, r_knee_y=-0.05,
r_foot_x=0.04, r_foot_y=-0.10,
l_knee_x=-0.035, l_knee_y=-0.05,
l_foot_x=-0.05, l_foot_y=-0.10),
},
{
'name': '8. Antalgic Gait\n(Pain Avoidance)',
'color': COLORS['antalgic'],
'lesion': 'Pain - Joint / Bone / Soft Tissue\n(Non-Neurological)',
'features': [
'Shortened stance phase on painful limb',
'Rapid transfer of weight to pain-free side',
'Reduced stride length overall',
'Trunk lean toward affected side (hip pain)',
'Causes: OA hip/knee, fracture, soft tissue injury',
],
'phase': 'Shortened stance phase on affected side',
'fig_params': dict(torso_lean=0.02,
r_knee_x=0.025, r_knee_y=-0.05,
r_foot_x=0.04, r_foot_y=-0.10,
l_knee_x=-0.03, l_knee_y=-0.05,
l_foot_x=-0.045, l_foot_y=-0.10),
},
{
'name': '9. Choreic Gait',
'color': COLORS['choreic'],
'lesion': 'Basal Ganglia\n(Huntington, Sydenham, etc.)',
'features': [
'Random involuntary movements during walking',
'"Dancing" quality - exaggerated limb/arm motion',
'Wide-based, lurching, stumbling steps',
'Variable step length and timing',
'Excessive trunk sway; may mimic ataxia',
],
'phase': 'Irregular timing; interruptions in swing & stance',
'fig_params': dict(torso_lean=0.025, r_arm_angle=35, l_arm_angle=155,
r_knee_x=0.04, r_knee_y=-0.04,
r_foot_x=0.065, r_foot_y=-0.10,
l_knee_x=-0.025, l_knee_y=-0.055,
l_foot_x=-0.035, l_foot_y=-0.095),
},
{
'name': '10. Dystonic Gait',
'color': COLORS['dystonic'],
'lesion': 'Basal Ganglia /\nCorticospinal Pathways',
'features': [
'Bizarre, sustained abnormal limb posturing',
'Excessive hip flexion ("peacock/simian" gait)',
'Foot: plantarflexion + inversion on action',
'Striatal toe (great toe extension) early sign',
'May walk sideways (crab-like) or hop',
],
'phase': 'Abnormal swing phase - sustained foot inversion',
'fig_params': dict(torso_lean=-0.01,
r_knee_x=0.045, r_knee_y=-0.03,
r_foot_x=0.03, r_foot_y=-0.10,
l_knee_x=-0.03, l_knee_y=-0.055,
l_foot_x=-0.05, l_foot_y=-0.10),
},
{
'name': '11. Functional /\nHysterical Gait',
'color': COLORS['functional'],
'lesion': 'Psychiatric / Behavioural\n(No organic lesion)',
'features': [
'Astasia-abasia: normal limbs, can\'t stand/walk',
'Tightrope walker - arms out, slow small steps',
'Reeling side to side - dramatic',
'Gait IMPROVES when distracted',
'Variable; inconsistent with neurological signs',
],
'phase': 'Inconsistent; varies with attention and observation',
'fig_params': dict(torso_lean=0.03, r_arm_angle=10, l_arm_angle=170,
r_knee_x=0.035, r_knee_y=-0.05,
r_foot_x=0.05, r_foot_y=-0.10,
l_knee_x=-0.035, l_knee_y=-0.05,
l_foot_x=-0.05, l_foot_y=-0.10),
},
]
# ═══════════════════════════════════════════════════════════════════════════
# LAYOUT: 4 columns × 3 rows (last card spans centre)
# ═══════════════════════════════════════════════════════════════════════════
COLS = 4
ROWS = 3
card_w = 0.215
card_h = 0.255
x_pad = 0.013
y_pad = 0.012
x0 = 0.02
y0 = 0.625 # top of first row (in figure coords, 0=bottom)
positions = []
for row in range(ROWS):
for col in range(COLS):
lx = x0 + col * (card_w + x_pad)
ly = y0 - row * (card_h + y_pad)
positions.append((lx, ly))
# Last card (index 10) centred at bottom
lx_last = 0.5 - card_w / 2
ly_last = y0 - ROWS * (card_h + y_pad)
positions.append((lx_last, ly_last))
for idx, gait in enumerate(gaits):
lx, ly = positions[idx]
col = COLORS.get(list(COLORS.keys())[idx])
c = gait['color']
ax = fig.add_axes([lx, ly, card_w, card_h])
ax.set_facecolor(BG_CARD)
ax.set_xlim(0, 1); ax.set_ylim(0, 1)
ax.axis('off')
# Coloured top bar
ax.add_patch(FancyBboxPatch((0, 0.82), 1.0, 0.18,
boxstyle='round,pad=0.01',
facecolor=c, edgecolor='none', clip_on=False))
# Number badge
ax.add_patch(Circle((0.07, 0.91), 0.055, color='#ffffff33', zorder=4, transform=ax.transAxes))
ax.text(0.07, 0.915, str(idx + 1), ha='center', va='center',
fontsize=11, fontweight='bold', color='white', zorder=5)
# Gait name
name_lines = gait['name'].split('\n')
ax.text(0.55, 0.912, name_lines[0], ha='center', va='center',
fontsize=11, fontweight='bold', color='white', clip_on=False)
if len(name_lines) > 1:
ax.text(0.55, 0.867, name_lines[1], ha='center', va='center',
fontsize=9.5, color='#ffffcc', clip_on=False)
# Stick figure (right side of card)
stick_figure(ax, cx=0.855, cy=0.61, scale=0.95,
head_color='#ffffff', body_color=c, lw=2.8,
**gait['fig_params'])
# Lesion box
ax.add_patch(FancyBboxPatch((0.02, 0.67), 0.70, 0.13,
boxstyle='round,pad=0.01',
facecolor=c + '33', edgecolor=c, lw=1.0))
ax.text(0.37, 0.733, '⚡ ' + gait['lesion'].replace('\n', ' '),
ha='center', va='center', fontsize=7.2,
color='#e0f2fe', fontweight='bold')
# Feature bullets
y_feat = 0.635
for feat in gait['features']:
ax.text(0.03, y_feat, '▶', ha='left', va='center',
fontsize=6.5, color=c)
ax.text(0.10, y_feat, feat, ha='left', va='center',
fontsize=7.0, color=TEXT_SUB)
y_feat -= 0.115
# Phase note
ax.add_patch(FancyBboxPatch((0.02, 0.02), 0.96, 0.08,
boxstyle='round,pad=0.01',
facecolor='#1a3a4a', edgecolor='#00bcd455', lw=0.8))
ax.text(0.50, 0.06, '⏱ ' + gait['phase'],
ha='center', va='center', fontsize=6.5, color='#80deea',
style='italic')
# Card border
for spine_dir in ['top', 'bottom', 'left', 'right']:
ax.spines[spine_dir].set_visible(False)
rect = FancyBboxPatch((0, 0), 1, 1,
boxstyle='round,pad=0.005',
facecolor='none', edgecolor=c, lw=1.5,
transform=ax.transAxes, clip_on=False)
ax.add_patch(rect)
# ═══════════════════════════════════════════════════════════════════════════
# COMPARISON TABLE (lower section)
# ═══════════════════════════════════════════════════════════════════════════
tbl_ax = fig.add_axes([0.02, 0.03, 0.96, 0.27])
tbl_ax.set_facecolor('#0d1b2a')
tbl_ax.set_xlim(0, 1); tbl_ax.set_ylim(0, 1)
tbl_ax.axis('off')
tbl_ax.text(0.5, 0.97, 'QUICK COMPARISON TABLE',
ha='center', va='top', fontsize=16, fontweight='bold', color=ACCENT)
headers = ['Gait Type', 'Lesion Site', 'Base of Support', 'Romberg', 'Phase Affected', 'Classic Cause']
col_x = [0.01, 0.18, 0.35, 0.48, 0.59, 0.80]
col_w = [0.16, 0.16, 0.12, 0.10, 0.20, 0.19]
# header row
hdr_y = 0.90
for hdr, cx in zip(headers, col_x):
tbl_ax.add_patch(FancyBboxPatch((cx, hdr_y - 0.045), col_w[headers.index(hdr)], 0.05,
boxstyle='round,pad=0.005',
facecolor='#0a3d62', edgecolor='#42a5f5', lw=0.8))
tbl_ax.text(cx + col_w[headers.index(hdr)] / 2, hdr_y - 0.02, hdr,
ha='center', va='center', fontsize=8.5,
fontweight='bold', color='#42a5f5')
rows_data = [
('Spastic Hemiparetic', 'Unilateral CST', 'Normal / narrow', 'Normal', 'Swing (circumduction)', 'Stroke, brain tumor'),
('Scissors', 'Bilateral CST', 'Normal / narrow', 'Normal', 'Swing (failed clearance)', 'Spinal cord compression'),
('Cerebellar Ataxic', 'Cerebellum', 'Wide', 'Absent', 'Both (irregular)', 'MS, stroke, alcohol'),
('Sensory Ataxic', 'Post. columns/PN','Wide', 'Present','IC (foot slap)', 'Vit B12 deficiency, tabes'),
('Parkinsonian', 'Basal ganglia', 'Normal/narrow', 'Normal', 'Swing (short stride)', 'Parkinson disease'),
('Steppage', 'Peroneal nerve', 'Normal', 'Normal', 'Swing (high-step)', 'Foot drop, neuropathy'),
('Waddling', 'Hip abductors', 'Normal / wide', 'Normal', 'Midstance (pelvic drop)', 'Muscular dystrophy'),
('Antalgic', 'Non-neurological','Normal', 'Normal', 'Stance (shortened)', 'OA hip/knee, fracture'),
('Choreic', 'Basal ganglia', 'Wide', 'Normal', 'Both (irregular)', 'Huntington disease'),
('Dystonic', 'BG / CST', 'Variable', 'Normal', 'Swing (foot inversion)', 'Primary torsion dystonia'),
('Functional', 'None (psychogenic)','Variable', 'Variable','Variable / inconsistent', 'Conversion disorder'),
]
for r_idx, row in enumerate(rows_data):
ry = hdr_y - 0.095 - r_idx * 0.073
bg = '#0d1f2d' if r_idx % 2 == 0 else '#112233'
c = list(COLORS.values())[r_idx]
for c_idx, (cell, cx) in enumerate(zip(row, col_x)):
tbl_ax.add_patch(FancyBboxPatch((cx, ry - 0.028), col_w[c_idx], 0.05,
boxstyle='round,pad=0.003',
facecolor=bg, edgecolor='#1a3a4a', lw=0.5))
color = c if c_idx == 0 else (TEXT_SUB if c_idx != 3 else ('#ff6b6b' if cell == 'Present' else ('#a5d6a7' if cell == 'Absent' else TEXT_SUB)))
tbl_ax.text(cx + col_w[c_idx] / 2, ry - 0.003, cell,
ha='center', va='center', fontsize=7.3,
color=color, fontweight=('bold' if c_idx == 0 else 'normal'))
# Footer
tbl_ax.text(0.5, 0.005, 'Sources: Miller\'s Review of Orthopaedics 9e • Bradley & Daroff\'s Neurology in Clinical Practice • Goldman-Cecil Medicine 22e',
ha='center', va='bottom', fontsize=7, color='#546e7a', style='italic')
# ═══════════════════════════════════════════════════════════════════════════
# SAVE
# ═══════════════════════════════════════════════════════════════════════════
out = '/tmp/workspace/gait-poster/Abnormal_Gait_Patterns_Poster.png'
fig.savefig(out, dpi=150, bbox_inches='tight', facecolor=fig.get_facecolor())
print(f'Saved: {out}')
plt.close(fig)
cd /tmp/workspace/gait-poster && python gait_poster.py 2>&1
cd /tmp/workspace/gait-poster && sed -i "s/'⏱ '/'[Phase] '/g" gait_poster.py && python gait_poster.py 2>&1
ls -lh /tmp/workspace/gait-poster/Abnormal_Gait_Patterns_Poster.png
Abnormal Gait Patterns Poster
Image · PNG
| # | Gait | Colour |
|---|---|---|
| 1 | Spastic Hemiparetic | Red |
| 2 | Scissors (Paraparetic) | Orange |
| 3 | Cerebellar Ataxic | Yellow |
| 4 | Sensory Ataxic | Green |
| 5 | Parkinsonian | Teal |
| 6 | Steppage (Foot Drop) | Blue |
| 7 | Waddling / Trendelenburg | Purple |
| 8 | Antalgic | Pink |
| 9 | Choreic | Coral |
| 10 | Dystonic | Amber |
| 11 | Functional / Hysterical | Lavender |