From 5d09ce37775dbda0372f61e9a4915e5a68190ecf Mon Sep 17 00:00:00 2001 From: hurry Date: Mon, 8 Jun 2026 22:01:10 +0800 Subject: [PATCH] Revert "Fix:theme_blank plot margin" --- R/themes.R | 11 +++++------ tests/testthat.R | 4 ---- tests/testthat/test-themes.R | 6 ------ 3 files changed, 5 insertions(+), 16 deletions(-) delete mode 100644 tests/testthat.R delete mode 100644 tests/testthat/test-themes.R diff --git a/R/themes.R b/R/themes.R index 8d8b321..103897b 100644 --- a/R/themes.R +++ b/R/themes.R @@ -158,10 +158,10 @@ theme_blank <- function( legend.margin = margin(0, 0, 0, 0), legend.key.size = grid::unit(10, "pt"), plot.margin = margin( - lab_size + 8, - lab_size + 8, - lab_size + 8, - lab_size + 8, + lab_size + 2, + lab_size + 2, + lab_size + 2, + lab_size + 2, unit = "points" ) ) @@ -212,8 +212,7 @@ theme_blank <- function( gp = grid::gpar(lwd = 2) ), grid::textGrob( - label = ylab, - x = grid::unit(0, "npc"), + label = ylab, x = grid::unit(0, "npc"), y = grid::unit(0, "npc"), vjust = -2 / 3, hjust = 0, diff --git a/tests/testthat.R b/tests/testthat.R deleted file mode 100644 index 818ccf8..0000000 --- a/tests/testthat.R +++ /dev/null @@ -1,4 +0,0 @@ -library(testthat) -library(thisplot) - -test_check("thisplot") diff --git a/tests/testthat/test-themes.R b/tests/testthat/test-themes.R deleted file mode 100644 index 907fcdf..0000000 --- a/tests/testthat/test-themes.R +++ /dev/null @@ -1,6 +0,0 @@ -test_that("theme_blank leaves room for coordinate annotation", { - theme_layers <- thisplot::theme_blank(add_coord = FALSE, lab_size = 12) - plot_margin <- theme_layers[[1]][[1]]$plot.margin - - expect_equal(as.numeric(plot_margin), rep(20, 4)) -})