Skip to content

feat(letsplot): implement sn-curve-basic#3837

Merged
github-actions[bot] merged 4 commits intomainfrom
implementation/sn-curve-basic/letsplot
Jan 15, 2026
Merged

feat(letsplot): implement sn-curve-basic#3837
github-actions[bot] merged 4 commits intomainfrom
implementation/sn-curve-basic/letsplot

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: sn-curve-basic - letsplot

Implements the letsplot version of sn-curve-basic.

File: plots/sn-curve-basic/implementations/letsplot.py

Parent Issue: #3826


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jan 15, 2026

AI Review - Attempt 1/3

Image Description

The plot displays an S-N curve (Wöhler Curve) for steel fatigue data on a log-log scale. The X-axis shows "Number of Cycles to Failure (N)" ranging from 100 to 10^7, and the Y-axis shows "Stress Amplitude (MPa)" ranging from approximately 158 to 501 MPa. Blue data points represent individual fatigue test specimens with visible scatter at each stress level. A solid blue Basquin fit line passes through the data showing the characteristic inverse relationship between stress and cycles.

Three horizontal dashed reference lines are prominently displayed:

  • Red dashed line at ~501 MPa labeled "Ultimate Strength"
  • Dark yellow/olive dashed line at ~355 MPa labeled "Yield Strength"
  • Green dashed line at 200 MPa labeled "Endurance Limit"

The title "sn-curve-basic · letsplot · pyplots.ai" appears at the top. The plot uses a minimal theme with light gray dashed grid lines. Text labels for the reference lines are positioned on the left side of the plot in matching colors. Overall the layout is clean and uses the canvas space effectively.

Quality Score: 91/100

Criteria Checklist

Visual Quality (36/40 pts)

  • VQ-01: Text Legibility (10/10) - Title, axis labels, and tick labels are all clearly readable at appropriate sizes
  • VQ-02: No Overlap (8/8) - No overlapping text elements; reference line labels are well positioned
  • VQ-03: Element Visibility (6/8) - Data points are visible with appropriate alpha; size could be slightly larger for better visibility
  • VQ-04: Color Accessibility (5/5) - Red, yellow, green reference lines are distinguishable; blue data/line has good contrast
  • VQ-05: Layout Balance (5/5) - Plot fills canvas well with balanced margins; good use of 16:9 aspect ratio
  • VQ-06: Axis Labels (2/2) - Both axes have descriptive labels with units: "Stress Amplitude (MPa)" and "Number of Cycles to Failure (N)"
  • VQ-07: Grid & Legend (0/2) - Grid is subtle and appropriate, but no legend for the data points/fit line

Spec Compliance (24/25 pts)

  • SC-01: Plot Type (8/8) - Correct S-N curve with log-log scales
  • SC-02: Data Mapping (5/5) - Cycles on X-axis, Stress on Y-axis as specified
  • SC-03: Required Features (4/5) - Has reference lines for Ultimate Strength, Yield Strength, and Endurance Limit; has fit line; missing explicit legend identifying curve elements
  • SC-04: Data Range (3/3) - Axes show full data range appropriately
  • SC-05: Legend Accuracy (2/2) - Reference line labels are accurate and color-matched
  • SC-06: Title Format (2/2) - Correct format: "sn-curve-basic · letsplot · pyplots.ai"

Data Quality (19/20 pts)

  • DQ-01: Feature Coverage (7/8) - Shows scatter from multiple specimens, Basquin fit, reference lines; could show more variation in scatter at different stress levels
  • DQ-02: Realistic Context (7/7) - Realistic steel fatigue test scenario with appropriate material properties
  • DQ-03: Appropriate Scale (5/5) - Stress values 200-500 MPa appropriate for structural steel; cycles 10^2 to 10^7 realistic

Code Quality (9/10 pts)

  • CQ-01: KISS Structure (3/3) - Clean imports → data → plot → save structure, no functions/classes
  • CQ-02: Reproducibility (3/3) - Uses np.random.seed(42)
  • CQ-03: Clean Imports (2/2) - Only necessary imports used
  • CQ-04: No Deprecated API (0/1) - Uses deprecated ggsave import pattern; should use lets_plot.export.ggsave
  • CQ-05: Output Correct (1/1) - Saves as plot.png

Library Features (3/5 pts)

  • LF-01: Distinctive Features (3/5) - Uses layer_tooltips for interactivity, ggplot grammar, but could leverage more lets-plot specific features

Strengths

  • Excellent implementation of S-N curve with proper log-log scaling
  • Clear horizontal reference lines with color-coded labels for Ultimate Strength, Yield Strength, and Endurance Limit
  • Realistic steel fatigue data using Basquin equation
  • Interactive tooltips for data points showing cycles and stress values
  • Clean code structure following KISS principles
  • Well-balanced canvas utilization with appropriate 16:9 aspect ratio

Weaknesses

  • Missing legend identifying the fit line and data points
  • Grid/legend score reduced due to no formal legend element

Verdict: APPROVED

@github-actions github-actions Bot added quality:91 Quality score 91/100 ai-approved Quality OK, ready for merge labels Jan 15, 2026
@github-actions github-actions Bot merged commit 64ed707 into main Jan 15, 2026
3 checks passed
@github-actions github-actions Bot deleted the implementation/sn-curve-basic/letsplot branch January 15, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-approved Quality OK, ready for merge quality:91 Quality score 91/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants