Skip to content

feat(plotly): implement sn-curve-basic#3838

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

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

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: sn-curve-basic - plotly

Implements the plotly version of sn-curve-basic.

File: plots/sn-curve-basic/implementations/plotly.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 testing. The X-axis shows "Cycles to Failure (N)" on a logarithmic scale from 100 to 100M, with minor tick marks at 2 and 5 intervals. The Y-axis shows "Stress Amplitude (MPa)" on a logarithmic scale from 200 to 750. The main data consists of yellow circular markers with blue borders representing test data points, showing natural scatter across multiple stress levels. A solid blue line (Basquin Fit) runs through the data showing the power-law relationship. Three horizontal dashed reference lines are displayed: a red dashed line at 650 MPa (Ultimate Strength), a green dashed line at 450 MPa (Yield Strength), and a purple dashed line at 230 MPa (Endurance Limit). The title "sn-curve-basic · plotly · pyplots.ai" is centered at the top. A legend in the upper right corner with a white semi-transparent background clearly identifies all five trace elements. The plot uses the plotly_white template with a clean white background and subtle gray gridlines.

Quality Score: 94/100

Criteria Checklist

Visual Quality (37/40 pts)

  • VQ-01: Text Legibility (10/10) - Title at 32pt, axis labels at 24pt, tick labels at 18pt, all perfectly readable
  • VQ-02: No Overlap (8/8) - No overlapping text elements, all labels and data clearly separated
  • VQ-03: Element Visibility (7/8) - Markers size 14 with blue border are well visible; some close data points at similar stress levels could benefit from slight alpha
  • VQ-04: Color Accessibility (5/5) - Colors (blue line, yellow markers, red/green/purple reference lines) are distinguishable and colorblind-friendly
  • VQ-05: Layout Balance (5/5) - Good use of canvas space, balanced margins, plot fills ~60% of area
  • VQ-06: Axis Labels (2/2) - Descriptive labels with units: "Cycles to Failure (N)", "Stress Amplitude (MPa)"
  • VQ-07: Grid & Legend (0/2) - Legend overlaps the fit line near the top, could be better positioned

Spec Compliance (25/25 pts)

  • SC-01: Plot Type (8/8) - Correct S-N curve with log-log axes
  • SC-02: Data Mapping (5/5) - Cycles on X-axis, Stress on Y-axis as specified
  • SC-03: Required Features (5/5) - All required features present: scatter data, fit line, reference lines for Ultimate/Yield/Endurance
  • SC-04: Data Range (3/3) - Shows full range from low-cycle to high-cycle fatigue regions
  • SC-05: Legend Accuracy (2/2) - All legend entries correctly describe their corresponding traces with MPa values
  • SC-06: Title Format (2/2) - Uses exact format "sn-curve-basic · plotly · pyplots.ai"

Data Quality (20/20 pts)

  • DQ-01: Feature Coverage (8/8) - Shows realistic scatter (multiple specimens per stress level), covers low-cycle to high-cycle fatigue regions, includes all key material properties
  • DQ-02: Realistic Context (7/7) - Steel fatigue testing scenario with realistic Basquin equation parameters (A=1200 MPa, b=-0.12), realistic stress levels 240-600 MPa
  • DQ-03: Appropriate Scale (5/5) - Stress values (240-650 MPa) and cycle counts (10²-10⁶) are realistic for steel materials

Code Quality (9/10 pts)

  • CQ-01: KISS Structure (3/3) - Clean linear flow: imports → data → plot → save, no functions/classes
  • CQ-02: Reproducibility (3/3) - Uses np.random.seed(42)
  • CQ-03: Clean Imports (2/2) - Only numpy and plotly.graph_objects imported, both used
  • CQ-04: No Deprecated API (1/1) - Modern plotly API usage
  • CQ-05: Output Correct (0/1) - Saves as both plot.png and plot.html (correct for plotly)

Library Features (3/5 pts)

  • LF-01: Uses distinctive library features (3/5) - Uses graph_objects with proper trace management, but doesn't leverage Plotly's interactive features like hover tooltips with custom data or zoom/pan configuration

Strengths

  • Excellent implementation of the S-N curve with all specification requirements met
  • Clear visualization with appropriate log-log scaling on both axes
  • Realistic simulated fatigue data using Basquin equation with proper scatter
  • All three reference lines (Ultimate, Yield, Endurance) clearly labeled with values
  • Clean, readable code following KISS principles
  • Proper use of plotly_white template for publication-quality appearance
  • Good marker styling with contrasting border colors

Weaknesses

  • Legend position overlaps with the fit line at the top of the plot area
  • Could leverage Plotly's hover capabilities to show stress/cycles values on hover
  • Markers could use slight alpha for overlapping points at same stress levels

Verdict: APPROVED

@github-actions github-actions Bot added quality:94 Quality score 94/100 ai-approved Quality OK, ready for merge labels Jan 15, 2026
@github-actions github-actions Bot merged commit 27de72a into main Jan 15, 2026
3 checks passed
@github-actions github-actions Bot deleted the implementation/sn-curve-basic/plotly branch January 15, 2026 20:52
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:94 Quality score 94/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants