Skip to content

feat: MATLAB-style figures with typeset symbols - #60

Merged
SMI-Lab-Inha merged 3 commits into
devfrom
feat/matlab-plot-style
Nov 22, 2026
Merged

SMI-Lab-Inha merged 3 commits into
devfrom
feat/matlab-plot-style

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Summary

CableXSec's figures used plain matplotlib defaults. Symbols were also typed as plain text (kappa, sigma_a, m^-1).

This PR gives every figure one MATLAB-style look. Labels now carry typeset Greek letters and sub- and superscripts.

Style (cablexsec.plotting.style)

Element Setting
Line colours MATLAB's default order: #0072BD, #D95319, #EDB120, #7E2F8E, #77AC30, #4DBEEE, #A2142F
Face Helvetica / Arial (Liberation, Nimbus, DejaVu fallbacks), 10 pt, labels 11 pt
Axes closed box; inward ticks on all four sides; no grid
Legend square, opaque
Mathtext custom sans in the same face, numerals upright (\mathrm)
Output 300 dpi (the docs figures are saved at 200 dpi, under the docs tests' 200 kB cap)
  • style.MATLAB_ORDER: the default line colours, in MATLAB's order.
  • style.COLORS: named MATLAB hues, plus black and grey.
  • style.LABELS: the standard axis labels. For example, Curvature $\kappa$ [m$^{\mathrm{-1}}$], and the moment, tension, stress, damage and slip labels.
  • The plotting modules use these: mkappa, capacity, fatigue, thermal, stress and cross_section.

Docs and examples

  • Tutorials 01–04 and how-to 04: the scripts call apply_style() and use LABELS and COLORS. Their eight figures are regenerated.
  • Examples: demo 02, 03 and 05 and rig_test_gauge_plan use the same labels.
  • doc/user_guide.md: new section 2.8, "Figures", covering the plotting functions and the style.
  • CHANGELOG.md: an entry under Unreleased/Changed.

Tests

  • tests/test_plotting_style.py, rewritten to the new specification:
    • the colour order;
    • the rcParams;
    • the labels;
    • that every plotting function draws with the style.
  • Checks run locally: ruff, ruff format, mypy and the plotting tests.

Every figure now uses one MATLAB-style look: MATLAB's default line
colours in MATLAB's order, a Helvetica/Arial face, a closed box with
inward ticks on all sides, no grid and a square opaque legend. Labels
carry true Greek letters and sub- and superscripts in the same face,
with numerals upright; style.LABELS holds the standard axis labels.

The tutorial and how-to scripts apply the style (their figures were
plain matplotlib defaults) and are regenerated; the examples use the
same labels. The user guide documents the figures and the style.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The docs figures are saved at 200 dpi: at the style's 300 dpi two of
them exceeded the docs tests' 200 kB cap. The micro prefix is the
upright text µ, not an italic \mu; an axis offset reads x10^-8 as in
MATLAB; the e1 subscript is upright; tutorial 01's curvature axis has
five ticks, which no longer run together.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T15:56:19.614526Z 99aa4b0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@read-the-docs-community

read-the-docs-community Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The rewritten style tests add one analytical_sanity test.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 99aa4b033d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SMI-Lab-Inha
SMI-Lab-Inha merged commit 8220830 into dev Nov 22, 2026
14 checks passed
SMI-Lab-Inha added a commit that referenced this pull request Nov 23, 2026
Every figure now uses one MATLAB-style look: MATLAB's default line
colours in MATLAB's order, a Helvetica/Arial face, a closed box with
inward ticks on all sides, no grid and a square opaque legend. Labels
carry true Greek letters and sub- and superscripts in the same face,
with numerals upright; style.LABELS holds the standard axis labels.

The tutorial and how-to scripts apply the style (their figures were
plain matplotlib defaults) and are regenerated; the examples use the
same labels. The user guide documents the figures and the style.

The docs figures are saved at 200 dpi, under the docs tests' size cap;
the micro prefix is upright and axis offsets read x10^-8.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha
SMI-Lab-Inha deleted the feat/matlab-plot-style branch November 23, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant