Skip to content

Fix plotSpectra axis limits#343

Merged
gustavdelius merged 1 commit into
masterfrom
fix/plot-spectra-axis-limits
May 12, 2026
Merged

Fix plotSpectra axis limits#343
gustavdelius merged 1 commit into
masterfrom
fix/plot-spectra-axis-limits

Conversation

@gustavdelius
Copy link
Copy Markdown
Member

Summary

Fixes #340.

  • plotSpectra() was pinning the y-axis lower limit to 1e-20 even when ylim[1] was not specified, causing a large empty region below the data on the log-scale plot. The 1e-20 threshold is now used only to filter near-zero values from the data; the y-axis auto-scales to the data range when ylim[1] is NA.
  • The default lower x-axis limit (wlim[1]) now depends on the resource argument: min(params@w) / 100 when resource = TRUE (existing behaviour, to show some resource below the fish grid) and min(params@w) when resource = FALSE.
  • Documentation for wlim and ylim parameters updated to describe this behaviour.

Test plan

  • Existing axis-limit test updated: y-axis lower limit is now NA (auto-scale) when ylim[1] is not specified.
  • New test verifies that default wlim[1] extends below min(params@w) with resource = TRUE and equals min(params@w) with resource = FALSE.
  • Full plot test suite passes: testthat::test_file("tests/testthat/test-plots.R") — 72 tests, 0 failures.

🤖 Generated with Claude Code

@gustavdelius gustavdelius merged commit 8d80cad into master May 12, 2026
1 check failed
@gustavdelius gustavdelius deleted the fix/plot-spectra-axis-limits branch May 12, 2026 07:19
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.

Set better defaults for axis ranges in plotSpectra()

1 participant