Types of gaits and definition and phase

Reading File
Now let me search the medical library for gait types and phases simultaneously.
Finding Sources
Finding Sources
Good results. Now let me read the key sections in parallel - Miller's Orthopaedics for gait cycle/phases and Bradley's Neurology for gait types.
Reading File
Reading File
Reading File
Excellent content. Let me now read the gait cycle phases from Miller's (offset ~1870) and more gait disorder types from Bradley's Neurology, and also check for an image.
Reading File
Reading File
Reading File
Let me get the remaining Miller's gait phases content and the rest of the gait types from Bradley's (ataxic, parkinsonian, sensory, etc.).
Reading File
Reading File
I now have rich content from the textbooks. Let me also fetch the gait image from Miller's for visual reference.
Finding Sources
Reading File
Reading File
I now have all the information needed for a comprehensive answer. Let me compile it.

Types of Gaits - Definition and Phases

Definition of Gait

Gait is the manner or pattern of walking. Normal walking describes an energy-efficient process of controlled, reciprocal lower limb movements used to move the body from one location to another while maintaining upright stability. - Miller's Review of Orthopaedics, 9th Ed.

The Normal Gait Cycle

One full gait cycle runs from heel strike (Initial Contact) to the next heel strike of the same foot - this is called a stride (= two steps).
  • Step: distance between successive Initial Contact by the two different lower limbs
  • Stride: distance between successive Initial Contact by the same lower limb
  • Cadence: steps per unit time
  • Running differs from walking in that it eliminates the double-limb support phase entirely (both feet briefly off the ground = "float phase")
The gait cycle is divided into two main phases:
Phase% of Gait CycleDescription
Stance Phase60%Weight-bearing; foot on the ground
Swing Phase40%Non-weight-bearing; foot off the ground
There are two periods of double-limb support (both feet on ground) during each cycle, occupying 20-30% of the total cycle. These occur during Initial Contact + Loading Response, and again during Preswing. - Miller's Review of Orthopaedics, 9th Ed.

Subdivisions of the Gait Cycle (Rancho Los Amigos System)

Stance Phase (60%) - 5 sub-phases:

Sub-phaseStartsEnds
1. Initial Contact (IC)The instant the reference foot contacts the ground-
2. Loading Response (LR)IC of the reference footInitial swing of the contralateral foot
3. Midstance (MSt)Initial swing of the advancing footBody's center of gravity is directly over the supporting forefoot
4. Terminal Stance (TSt)Heel riseIC of the contralateral (advancing) foot
5. Preswing (PSw)IC of the contralateral limbReference foot lifts off the ground

Swing Phase (40%) - 3 sub-phases:

Sub-phaseStartsEnds
1. Initial Swing (ISw)Reference foot leaves the groundSwinging foot is opposite the stance foot
2. MidswingSwinging foot opposite stance footTibia of swinging limb is perpendicular/vertical to the ground
3. Terminal Swing (TSw)Tibia is vertical/perpendicularFoot makes Initial Contact with the ground
Requirements for normal gait: stance-phase stability, swing-phase ground clearance, correct foot position before Initial Contact, and energy-efficient step length and speed. - Miller's Review of Orthopaedics, 9th Ed.

Types of Abnormal Gaits

1. Spastic Gait (Hemiparetic)

  • Lesion: Unilateral corticospinal tract (brain or cervical cord)
  • Appearance: Affected arm is adducted, internally rotated at the shoulder, flexed at the elbow, with forearm pronation and wrist/finger flexion. The leg is slightly flexed at the hip and extended at the knee, with plantarflexion and inversion of the foot. Swing phase accomplished by lateral trunk flexion and hip circumduction - "circumduction gait." Toe dragging is common. Shoe wear on the toe/outer border.

2. Spastic Paraparesis (Scissors Gait)

  • Lesion: Bilateral corticospinal tracts (spinal cord)
  • Appearance: Both legs stiffly extended at the knees, plantarflexed at ankles. Toes catch on floor with each step. Strong tendency to adduct the legs, creating a "scissors" pattern. Gait is slow and labored.

3. Cerebellar Ataxic Gait

  • Lesion: Cerebellum or brainstem
  • Appearance: Wide-based stance, lurching and staggering quality. Steps are irregular in timing (dyssynergia), length, and direction (dysmetria). Romberg sign absent (ataxia not worsened by closing eyes). Midline cerebellar lesions cause truncal ataxia; hemispheric lesions cause ipsilateral limb ataxia.

4. Sensory (Posterior Column) Ataxic Gait

  • Lesion: Posterior columns of spinal cord or peripheral nerve
  • Appearance: Wide-based, high-stepping "stomping" gait. Romberg sign present (dramatically worsened by eye closure, as the patient loses all proprioceptive compensation). Patient watches the ground to compensate for loss of joint position sense.

5. Hypokinetic / Parkinsonian Gait

  • Lesion: Basal ganglia (substantia nigra)
  • Appearance: Stooped posture with flexion of shoulders, neck, and trunk. Shuffling small steps, reduced arm swing (often asymmetric early). Festination = rapid small steps to prevent falling forward. Freezing episodes (inability to initiate steps). Retropulsion and propulsion (flurry of steps to maintain balance). - Bradley and Daroff's Neurology in Clinical Practice

6. Steppage Gait (Foot Drop Gait)

  • Lesion: Distal muscle weakness - peroneal nerve palsy, peripheral neuropathy, tibialis anterior rupture
  • Appearance: Increased hip and knee flexion during swing phase ("high stepping") to clear the toes from the floor. Foot slaps on the ground at Initial Contact. - Miller's Review of Orthopaedics, 9th Ed.

7. Waddling Gait (Trendelenburg Gait)

  • Lesion: Proximal muscle weakness (hip abductors) - muscular dystrophy, myopathy, hip pathology
  • Appearance: Exaggerated seesaw/side-to-side trunk sway. With weight bearing on the affected side, the pelvis drops and the trunk shifts to the normal side (positive Trendelenburg sign). Both legs circumducted to allow knee locking.

8. Antalgic Gait

  • Lesion: Non-neurological - pain from joint disease, fracture, or soft tissue injury
  • Appearance: Shortened stance phase on the affected side. The patient minimizes time weight is borne on the painful limb. Very common in hip/knee OA and after trauma.

9. Calcaneus Gait

  • Lesion: Weakness of triceps surae (gastrocnemius-soleus)
  • Appearance: Increased ankle dorsiflexion during heel strike; patient walks on the heel.

10. Choreic Gait

  • Lesion: Basal ganglia (Huntington disease, Sydenham chorea, etc.)
  • Appearance: Random involuntary movements superimpose on walking, giving a "dancing" quality. Wide-based, lurching, stumbling, stuttering steps. Trunk sways excessively; steps vary in length and timing. May be mistaken for ataxia.

11. Dystonic Gait

  • Lesion: Basal ganglia; also corticospinal pathways
  • Appearance: Bizarre, inexplicable postures of legs and trunk. Classic feature is excessive hip flexion during walking. Patients may hop, walk sideways (crab-like), or display a "peacock gait" (excessive hip and knee flexion with plantarflexion). Striatal toe (tonic great toe extension) may be an early sign.

12. Spastic Ataxia ("Bouncing Gait")

  • Lesion: Combined corticospinal and cerebellar (e.g., multiple sclerosis, Arnold-Chiari malformation)
  • Appearance: Wide-based gait with clonus precipitated by standing/walking, creating a "bouncing" motion. Ataxic movements and clonus form a vicious cycle.

13. Gait Disorder of the Elderly

  • Cause: Multifactorial - bihemispheric disease, spinal cord disease, impaired proprioception, muscle weakness
  • Appearance: Stooped posture, wide-based steps, often retropulsion (tendency to fall backward).

14. Hysterical / Functional Gait

  • Cause: Psychiatric or behavioral disorder
  • Appearance: Reeling side to side, astasia-abasia (normal limb power supine but inability to stand/walk), tightrope walker's gait (short slow steps, hips/knees flexed, arms outstretched), knee-buckling gait, dragging gait. Characteristically varies when distracted or when walking backward.

Summary Table

Gait TypeLesion LocationKey Feature
Spastic hemipareticUnilateral corticospinalCircumduction, arm flexion
Scissors (spastic paraparetic)Bilateral cordLeg adduction, toe catching
Cerebellar ataxicCerebellumWide base, Romberg -
Sensory ataxicPosterior columns/PNSWide base, Romberg +
ParkinsonianBasal gangliaShuffle, festination, freeze
SteppagePeroneal nerve/foot dropHigh-step, foot slap
WaddlingHip abductorsTrunk sway, Trendelenburg
AntalgicPain (joints/bones)Short stance on painful side
ChoreicBasal gangliaDancing, lurching
DystonicBG/corticospinalBizarre postures, hip flexion
FunctionalPsychiatricVariable, improves distracted
Sources: Miller's Review of Orthopaedics, 9th Ed. | Bradley and Daroff's Neurology in Clinical Practice | Goldman-Cecil Medicine, 22nd Ed.

Create a visual diagram or poster comparing abnormal gait patterns

Generating Image

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

I'll create a detailed visual poster as a PDF/image using Python in the sandbox.
Running Command

mkdir -p /tmp/workspace/gait-poster && ls /tmp/workspace/gait-poster/

Writing File

~/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)
Running Command

cd /tmp/workspace/gait-poster && python gait_poster.py 2>&1

Generated successfully. Let me fix the missing stopwatch glyph and verify the output looks good.
Running Command

cd /tmp/workspace/gait-poster && sed -i "s/'⏱ '/'[Phase] '/g" gait_poster.py && python gait_poster.py 2>&1

Clean output, no warnings. Let me preview it.
Loading Image
Running Command

ls -lh /tmp/workspace/gait-poster/Abnormal_Gait_Patterns_Poster.png

File is 829 KB and rendered cleanly. Let me mark the task complete.Your poster is ready for download:

Abnormal Gait Patterns Poster

Image · PNG


Here's what the poster includes:
Top banner - Gait cycle reminder strip showing Stance Phase (60%) and Swing Phase (40%) with sub-phases labelled.
11 colour-coded cards (each with a unique accent colour), arranged in a 4×3 grid + 1 centred card:
#GaitColour
1Spastic HemipareticRed
2Scissors (Paraparetic)Orange
3Cerebellar AtaxicYellow
4Sensory AtaxicGreen
5ParkinsonianTeal
6Steppage (Foot Drop)Blue
7Waddling / TrendelenburgPurple
8AntalgicPink
9ChoreicCoral
10DystonicAmber
11Functional / HystericalLavender
Each card contains:
  • Stick figure in the matching colour demonstrating the characteristic posture
  • Lesion location in a highlighted box
  • 5 key clinical features as bullet points
  • Gait phase affected note at the bottom
Bottom section - Full comparison table with columns for Lesion Site, Base of Support, Romberg Sign (Present/Absent highlighted), Phase Affected, and Classic Cause - all 11 gaits side by side.
This is a shared conversation. Sign in to Orris to start your own chat.