From 84d9311119a105f18a10ead643653b52d30b1006 Mon Sep 17 00:00:00 2001 From: simonpcouch Date: Mon, 15 Jul 2024 13:01:37 -0500 Subject: [PATCH] supply more informative axis breaks in `scale_*_bench_*()` --- NEWS.md | 3 +++ R/bytes.R | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 2b9d9d3..189b632 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # bench (development version) +* `scale_*_bench_*()` functions now supply more informative axis breaks + (@simonpcouch, #143). + # bench 1.1.3 * Long unnamed `bench_expr` expressions are now truncated correctly when used as diff --git a/R/bytes.R b/R/bytes.R index 9e59dc2..c22332d 100644 --- a/R/bytes.R +++ b/R/bytes.R @@ -170,7 +170,7 @@ bench_bytes_trans <- function(base = 2) { if (is.null(base)) { return( scales::trans_new("bch:byt", as.numeric, as_bench_bytes, - scales::pretty_breaks(), domain = c(1e-100, Inf) + breaks = scales::pretty_breaks(), domain = c(1e-100, Inf) ) ) } @@ -178,7 +178,7 @@ bench_bytes_trans <- function(base = 2) { inv <- function(x) as_bench_bytes(base ^ as.numeric(x)) scales::trans_new(paste0("bch:byt-", format(base)), trans, inv, - scales::log_breaks(base = base), domain = c(1e-100, Inf)) + breaks = scales::log_breaks(base = base), domain = c(1e-100, Inf)) } scale_type.bench_bytes <- function(x) "bench_bytes"