Skip to content

Dynmar log axes - #728

Merged
grantmcdermott merged 3 commits into
mainfrom
dynmar_log_axes
Sep 11, 2026
Merged

Dynmar log axes#728
grantmcdermott merged 3 commits into
mainfrom
dynmar_log_axes

Conversation

@grantmcdermott

Copy link
Copy Markdown
Owner

Fixes #725

Solution is to grab the log state for the (top-level) log argument and avoid the stale par('log') value.

pkgload::load_all("~/Documents/Projects/tinyplot")
#> ℹ Loading tinyplot
set.seed(20260911)
library(data.table)
#> 
#> Attaching package: 'data.table'
#> 
#> The following object is masked from 'package:base':
#> 
#>     %notin%
aggWeekly <- data.table(day=as.Date("2025-05-01") + (0:79)*7, n = 100000 + cumsum(rnorm(80,100000,25000)))
tinytheme("ipsum")
plt(n ~ day, aggWeekly, log="y", type="l", ylab="", xlab="", main="Main title")

plt(n ~ day, aggWeekly, log="y", type="l", ylab="", xlab="", main="Main title")

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation consistently removes reliance on stale device state and includes focused regression coverage.

Pull request overview

Fixes stale logarithmic-axis state during dynamic margin calculation for consecutive plots.

Changes:

  • Derives log state from the current log argument.
  • Centralizes log-coordinate axis-limit handling.
  • Adds regression coverage and release notes.
File summaries
File Description
R/tinyplot.R Uses current log state for margin calculations.
R/tinyAxis.R Adds shared log-aware axis-limit conversion.
R/facet.R Applies current log state to faceted margins.
NEWS.md Documents the bug fix.
inst/tinytest/test-tinyAxis.R Tests consecutive dynamic log plots.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@grantmcdermott
grantmcdermott merged commit fb3982a into main Sep 11, 2026
5 of 6 checks passed
@grantmcdermott
grantmcdermott deleted the dynmar_log_axes branch September 11, 2026 23:14
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.

Log-y axis no longer (re)setting under ipsum theme?

2 participants