Align all paper example figures with MATLAB layouts and styles#76
Merged
iahncajigas merged 12 commits intomainfrom Mar 24, 2026
Merged
Align all paper example figures with MATLAB layouts and styles#76iahncajigas merged 12 commits intomainfrom
iahncajigas merged 12 commits intomainfrom
Conversation
Part B (Figures 3-4): - Replace sinusoidal trajectory with minimum-jerk reaching dynamics (cosine acceleration toward target), matching MATLAB exactly - Fix encoding parameters: delta=0.001, mu=log(10*delta)+randn, beta=10*(rand-0.5) uniform velocity tuning - Figure 3: 4x2 layout with reach path, pos/vel traces, raster, CIF - Figure 4: overlaid decoded trajectories (20 runs, blue=goal, green=free) Part C (Figures 5-6): - Load 6-state fixture (paperHybridFilterExample.mat) with 2D hold and 6D reach modes, matching MATLAB's different-dimension-per-mode hybrid filter architecture - Figure 5: 4x2 layout with reach path, pos/vel traces, raster, discrete state (N/M) - Figure 6: 4x3 layout with state estimation, P(M|data), 2D decoded path, per-component traces — averaged over 20 simulations with both goal-directed and free hybrid decoding Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The likelihood computation in PPHybridFilterLinear and PPHybridFilter used sqrt(det(W_u)) / max(sqrt(det(W_p)), 1e-15) which catastrophically fails for ≥6-D states: with eigenvalues ~1e-10, det ≈ 1e-46 and sqrt(det) ≈ 1e-23 — far below the 1e-15 floor — collapsing the reach model likelihood to zero permanently. Replace with np.linalg.slogdet() log-space computation that matches MATLAB's raw det ratio while avoiding overflow/underflow. Verified: 100% discrete-state agreement with MATLAB (fixed) on the paperHybridFilterExample fixture for both free and goal-directed cases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Regenerated all 24 figures across 5 paper examples with latest code - Re-executed all 29 help notebooks (helpfiles) with fresh outputs - Added example figure exports to examples/paper/figures/ (new) - Updated docs/figures/ gallery with cleaned manifest-matching figures - Fixed test_network_tutorial_builder to strip execution metadata Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Documentation links now point to actual Sphinx-generated paths (help/index.html, help/paper_overview.html, etc.) instead of non-existent flat filenames (NeuralSpikeAnalysis_top.html, etc.) - Fix parity report link: parity/parity_report.md -> parity/report.md - Add parity dashboard and API reference links - Remove stale DocumentationSetup.md source page reference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…, and styles
Cross-referenced all MATLAB example scripts against Python to match subplot
grids, axis labels, title text, font properties (Arial, bold, 12-16pt),
line widths, marker styles, tick formatting, and legend content.
Key changes per example:
- Ex01: Replace plotResults() with explicit 2x2 grid matching MATLAB (raster,
InvGausTrans, KSPlot, lambda); add red epoch lines and dual-lambda plot
- Ex02: Match MATLAB 16pt titles, axis tick formatting, suppress top-panel
x-labels, use "Displacement Velocity" title, hide coefficient legend
- Ex03: Match MATLAB CIF title wording, mesh wireframe appearance with
edgecolor/alpha, figsize (14,9) for surface plots
- Ex04: Add axis('square'), XTick/YTick [-1:0.5:1], Cell# titles, legend on
subplot 4, remove subplot borders for place fields, sgtitle format
- Ex05: Match figsize (14,9), linewidth=4 for decoded traces, 18pt title,
show all cells in hybrid raster, suppress raster x-labels
Regenerated all 25 figures in both examples/paper/figures/ and docs/figures/.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test_readme_links_to_help_navigation_pages test expects all five MATLAB-style navigation pages to be linked in the README. The DocumentationSetup.md page existed in docs/ but was not listed in the Source pages section. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Figure fixes (all 5 examples): - Ex01 Fig3: Epoch lines bounded to [0,1] instead of full y-axis (axvline → plot) - Ex02 Fig1: Add axis linewidth=1 on subplots 2-3 (matching MATLAB set(gca,'LineWidth',1)) - Ex03 Fig3: CIF heatmap uses jet colormap (matching MATLAB imagesc default) - Ex03 Fig5: plot_wireframe instead of plot_surface (matching MATLAB mesh()) - Ex03 Fig2: PSTH/GLM z-order swapped to match MATLAB (GLM drawn before PSTH markers) - Ex03 Fig6: Significance markers markersize 3→6; axis label positions moved to top/right - Ex04 Fig1: Aspect ratio 12×10→14×9 (matching MATLAB 1400×900) - Ex04 Fig2: Figure height 5→9 inches - Ex04 Figs3-6: Fixed heatmap heights to 14×9 instead of scaling with row count - Ex04 Fig7: plot_wireframe instead of plot_surface with Line2D legend entries - Ex05: Raster markersize 2→4; added missing "Stimulus" ylabel on Fig2 README restructured to match MATLAB README flow: - Added subtitle "Neural Spike Train Analysis Toolbox for Python" - Moved CI badge to after title - Removed broken pages.yml badge (no workflow exists) - Consolidated install/data/setup into single "How to install nSTAT" section - Merged License, Cite, Data into single section - Added PyPI install one-liner before lab websites Docs: - Added CITATION.cff mirroring MATLAB repo - Regenerated all 25 paper-example figures Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
85283d5 to
93bf900
Compare
- example03: Add missing K_mesh/T_mesh meshgrid for Figure 5 wireframe surfaces (NameError at runtime) - example05: Add missing _simulate_binomial_spikes() helper that computes CIF from state/coefficients then draws spikes (NameError in Parts B/C) - example05: Fix x_true → stimSignal reference in Figure 2 plotting - example05: Remove dead "setup" key from _load_hybrid_fixture() return - Regenerate all affected figures for examples 03 and 05 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- AnalysisExamples2.ipynb: getCoeffs() returns (coeffs, labels, SE) tuple, need [0] to extract coefficient array for subtraction - StimulusDecode2D.ipynb: parity note said 'exact' but parity_notes.yml says 'high_fidelity'; align notebook to YAML Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Trim algorithm-specific details from overview (SSGLM, UKF, PPAF, PPHF) to match MATLAB's general-purpose intro paragraphs - Move Plot Style into Paper Examples section (matching MATLAB placement) - Add Quickstart block (matching MATLAB's run_all_checks one-liner) - Simplify Documentation to single GitHub Pages URL (matching MATLAB) - Remove standalone Supplementary Examples and Developer Notes sections - Trim Toolbox Map to 5 bullets matching MATLAB's structure - Consolidate citation/license into flowing prose (matching MATLAB) - Update test_docs_surface.py: replace per-page README link test with GitHub Pages site link test (mirrors MATLAB README structure) - Fix StimulusDecode2D.ipynb parity note remaining_differences to match parity_notes.yml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- paper_gallery.py: Output "## Paper Examples (Self-Contained)" heading to match MATLAB's "Paper Examples (Self-Contained)" section structure - paper_gallery.py: Remove Supplementary Examples from generated output (MATLAB README has no equivalent section) - paper_gallery.py: Update README delimiters for new section headings - test_docs_surface.py: Replace per-page README link tests with GitHub Pages URL and PaperOverview link tests (matching MATLAB's single-URL documentation reference) - StimulusDecode2D.ipynb: Align parity note with parity_notes.yml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…le04 figures - test_paper_gallery_docs.py: Update delimiter from "## Examples" to "## Paper Examples (Self-Contained)" / "Plot style policy:" - test_readme_examples_catalog.py: Remove Supplementary Examples test (section removed from README for MATLAB parity); update block extractor - test_readme_nstatpaperexamples.py: Update regex for new section heading - Regenerate example04 figures at full DPI=250 resolution (3500x2250) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/paper/figures/anddocs/figures/Per-example changes
plotResults()with explicit 2×2 grid matching MATLAB (raster + InvGausTrans + KSPlot + lambda); added red epoch lines and dual-lambda overlay in Figure 3axis('square'), XTick/YTick[-1:0.5:1],Cell#titles, legend on subplot 4, removed subplot borders for place fields, matchedsgtitleformatTest plan
--export-figurespytest tests/ -k paper)🤖 Generated with Claude Code