From 6488f39d6b4552f626798b966c01837a253c9e28 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Mon, 8 Jul 2024 14:44:56 +0200 Subject: [PATCH 1/2] internally set `lineend` in axis --- R/guide-axis.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/guide-axis.R b/R/guide-axis.R index dc57ffd23e..8790a8891d 100644 --- a/R/guide-axis.R +++ b/R/guide-axis.R @@ -242,6 +242,8 @@ GuideAxis <- ggproto( }, setup_elements = function(params, elements, theme) { + theme$axis.line <- theme$axis.line %||% element_line(inherit.blank = TRUE) + theme$axis.line$lineend <- theme$axis.line$lineend %||% "square" is_char <- vapply(elements, is.character, logical(1)) suffix <- params$theme_suffix %||% paste(params$aes, params$position, sep = ".") From 03e65795898ce6b2f6f16af0beadcd9dc742d9dd Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Mon, 8 Jul 2024 14:45:12 +0200 Subject: [PATCH 2/2] accept snapshot changes --- .../testthat/_snaps/guides/axis-guides-basic.svg | 8 ++++---- .../_snaps/guides/axis-guides-check-overlap.svg | 8 ++++---- .../guides/axis-guides-negative-rotation.svg | 8 ++++---- .../guides/axis-guides-positive-rotation.svg | 8 ++++---- .../axis-guides-text-dodged-into-rows-cols.svg | 8 ++++---- .../axis-guides-vertical-negative-rotation.svg | 8 ++++---- .../guides/axis-guides-vertical-rotation.svg | 8 ++++---- .../guides/axis-guides-with-capped-ends.svg | 8 ++++---- .../_snaps/guides/axis-guides-zero-breaks.svg | 8 ++++---- .../_snaps/guides/axis-guides-zero-rotation.svg | 8 ++++---- ...e-axis-theta-with-angle-adapting-to-theta.svg | 2 +- .../_snaps/guides/left-aligned-legend-key.svg | 4 ++-- .../guides/logtick-axes-with-customisation.svg | 8 ++++---- tests/testthat/_snaps/guides/stacked-axes.svg | 16 ++++++++-------- .../_snaps/guides/stacked-radial-axes.svg | 8 ++++---- .../_snaps/theme/theme-classic-large.svg | 4 ++-- tests/testthat/_snaps/theme/theme-classic.svg | 4 ++-- 17 files changed, 63 insertions(+), 63 deletions(-) diff --git a/tests/testthat/_snaps/guides/axis-guides-basic.svg b/tests/testthat/_snaps/guides/axis-guides-basic.svg index ae2a74c24d..3e8f03b081 100644 --- a/tests/testthat/_snaps/guides/axis-guides-basic.svg +++ b/tests/testthat/_snaps/guides/axis-guides-basic.svg @@ -59,28 +59,28 @@ - + 1 2 3 - + 1 2 3 - + 1 2 3 - + 1 2 3 diff --git a/tests/testthat/_snaps/guides/axis-guides-check-overlap.svg b/tests/testthat/_snaps/guides/axis-guides-check-overlap.svg index cf2312f98c..a6f43d3d78 100644 --- a/tests/testthat/_snaps/guides/axis-guides-check-overlap.svg +++ b/tests/testthat/_snaps/guides/axis-guides-check-overlap.svg @@ -59,7 +59,7 @@ - + @@ -89,7 +89,7 @@ 15,000,000,000 12,000,000,000 17,000,000,000 - + @@ -130,7 +130,7 @@ 16,000,000,000 18,000,000,000 19,000,000,000 - + @@ -160,7 +160,7 @@ 15,000,000,000 12,000,000,000 17,000,000,000 - + 1,000,000,000 20,000,000,000 10,000,000,000 diff --git a/tests/testthat/_snaps/guides/axis-guides-negative-rotation.svg b/tests/testthat/_snaps/guides/axis-guides-negative-rotation.svg index f5ad2b2273..653f94f8fc 100644 --- a/tests/testthat/_snaps/guides/axis-guides-negative-rotation.svg +++ b/tests/testthat/_snaps/guides/axis-guides-negative-rotation.svg @@ -59,7 +59,7 @@ - + @@ -80,7 +80,7 @@ 8,000 9,000 10,000 - + @@ -101,7 +101,7 @@ 8,000 9,000 10,000 - + @@ -122,7 +122,7 @@ 8,000 9,000 10,000 - + 1,000 2,000 3,000 diff --git a/tests/testthat/_snaps/guides/axis-guides-positive-rotation.svg b/tests/testthat/_snaps/guides/axis-guides-positive-rotation.svg index e1cd91eb77..70f3e16941 100644 --- a/tests/testthat/_snaps/guides/axis-guides-positive-rotation.svg +++ b/tests/testthat/_snaps/guides/axis-guides-positive-rotation.svg @@ -59,7 +59,7 @@ - + @@ -80,7 +80,7 @@ 8,000 9,000 10,000 - + @@ -101,7 +101,7 @@ 8,000 9,000 10,000 - + @@ -122,7 +122,7 @@ 8,000 9,000 10,000 - + 1,000 2,000 3,000 diff --git a/tests/testthat/_snaps/guides/axis-guides-text-dodged-into-rows-cols.svg b/tests/testthat/_snaps/guides/axis-guides-text-dodged-into-rows-cols.svg index 79e94af549..582e446d68 100644 --- a/tests/testthat/_snaps/guides/axis-guides-text-dodged-into-rows-cols.svg +++ b/tests/testthat/_snaps/guides/axis-guides-text-dodged-into-rows-cols.svg @@ -59,7 +59,7 @@ - + @@ -80,7 +80,7 @@ 6,000,000,000 8,000,000,000 10,000,000,000 - + @@ -101,7 +101,7 @@ 6,000,000,000 8,000,000,000 10,000,000,000 - + @@ -122,7 +122,7 @@ 6,000,000,000 8,000,000,000 10,000,000,000 - + 1,000,000,000 3,000,000,000 5,000,000,000 diff --git a/tests/testthat/_snaps/guides/axis-guides-vertical-negative-rotation.svg b/tests/testthat/_snaps/guides/axis-guides-vertical-negative-rotation.svg index fb7d39a9d3..19b77438a3 100644 --- a/tests/testthat/_snaps/guides/axis-guides-vertical-negative-rotation.svg +++ b/tests/testthat/_snaps/guides/axis-guides-vertical-negative-rotation.svg @@ -59,7 +59,7 @@ - + @@ -80,7 +80,7 @@ 8,000 9,000 10,000 - + @@ -101,7 +101,7 @@ 8,000 9,000 10,000 - + @@ -122,7 +122,7 @@ 8,000 9,000 10,000 - + 1,000 2,000 3,000 diff --git a/tests/testthat/_snaps/guides/axis-guides-vertical-rotation.svg b/tests/testthat/_snaps/guides/axis-guides-vertical-rotation.svg index f379bb7797..9c68463d06 100644 --- a/tests/testthat/_snaps/guides/axis-guides-vertical-rotation.svg +++ b/tests/testthat/_snaps/guides/axis-guides-vertical-rotation.svg @@ -59,7 +59,7 @@ - + @@ -80,7 +80,7 @@ 8,000 9,000 10,000 - + @@ -101,7 +101,7 @@ 8,000 9,000 10,000 - + @@ -122,7 +122,7 @@ 8,000 9,000 10,000 - + 1,000 2,000 3,000 diff --git a/tests/testthat/_snaps/guides/axis-guides-with-capped-ends.svg b/tests/testthat/_snaps/guides/axis-guides-with-capped-ends.svg index 393ffb017b..f50e7c4888 100644 --- a/tests/testthat/_snaps/guides/axis-guides-with-capped-ends.svg +++ b/tests/testthat/_snaps/guides/axis-guides-with-capped-ends.svg @@ -75,14 +75,14 @@ - + 100 200 300 - + 100 200 300 @@ -91,7 +91,7 @@ - + @@ -100,7 +100,7 @@ 200 300 400 - + diff --git a/tests/testthat/_snaps/guides/axis-guides-zero-breaks.svg b/tests/testthat/_snaps/guides/axis-guides-zero-breaks.svg index 2ef933e31b..f98d17b637 100644 --- a/tests/testthat/_snaps/guides/axis-guides-zero-breaks.svg +++ b/tests/testthat/_snaps/guides/axis-guides-zero-breaks.svg @@ -59,9 +59,9 @@ - - - - + + + + diff --git a/tests/testthat/_snaps/guides/axis-guides-zero-rotation.svg b/tests/testthat/_snaps/guides/axis-guides-zero-rotation.svg index bb81af4971..bd20897909 100644 --- a/tests/testthat/_snaps/guides/axis-guides-zero-rotation.svg +++ b/tests/testthat/_snaps/guides/axis-guides-zero-rotation.svg @@ -59,7 +59,7 @@ - + @@ -80,7 +80,7 @@ 8,000 9,000 10,000 - + @@ -101,7 +101,7 @@ 8,000 9,000 10,000 - + @@ -122,7 +122,7 @@ 8,000 9,000 10,000 - + 1,000 2,000 3,000 diff --git a/tests/testthat/_snaps/guides/guide-axis-theta-with-angle-adapting-to-theta.svg b/tests/testthat/_snaps/guides/guide-axis-theta-with-angle-adapting-to-theta.svg index b6cfa798fc..be2acec3ee 100644 --- a/tests/testthat/_snaps/guides/guide-axis-theta-with-angle-adapting-to-theta.svg +++ b/tests/testthat/_snaps/guides/guide-axis-theta-with-angle-adapting-to-theta.svg @@ -172,7 +172,7 @@ - + 10 15 20 diff --git a/tests/testthat/_snaps/guides/left-aligned-legend-key.svg b/tests/testthat/_snaps/guides/left-aligned-legend-key.svg index fc84b274ea..f591bfa25f 100644 --- a/tests/testthat/_snaps/guides/left-aligned-legend-key.svg +++ b/tests/testthat/_snaps/guides/left-aligned-legend-key.svg @@ -80,7 +80,7 @@ - + 10 15 20 @@ -93,7 +93,7 @@ - + diff --git a/tests/testthat/_snaps/guides/logtick-axes-with-customisation.svg b/tests/testthat/_snaps/guides/logtick-axes-with-customisation.svg index ec99938f19..e70a0c8116 100644 --- a/tests/testthat/_snaps/guides/logtick-axes-with-customisation.svg +++ b/tests/testthat/_snaps/guides/logtick-axes-with-customisation.svg @@ -31,7 +31,7 @@ - + @@ -96,7 +96,7 @@ 1 10 100 - + 10 100 1000 @@ -127,7 +127,7 @@ - + @@ -150,7 +150,7 @@ 10 100 1000 - + diff --git a/tests/testthat/_snaps/guides/stacked-axes.svg b/tests/testthat/_snaps/guides/stacked-axes.svg index 9ed86845f6..cc3bf12f57 100644 --- a/tests/testthat/_snaps/guides/stacked-axes.svg +++ b/tests/testthat/_snaps/guides/stacked-axes.svg @@ -75,21 +75,21 @@ - + 100 200 300 - + 100 200 300 - + 100 200 300 @@ -98,7 +98,7 @@ - + 100 200 300 @@ -107,7 +107,7 @@ - + @@ -116,7 +116,7 @@ 200 300 400 - + @@ -125,14 +125,14 @@ 200 300 400 - + 100 200 300 - + diff --git a/tests/testthat/_snaps/guides/stacked-radial-axes.svg b/tests/testthat/_snaps/guides/stacked-radial-axes.svg index 18609a9a74..b4787142cf 100644 --- a/tests/testthat/_snaps/guides/stacked-radial-axes.svg +++ b/tests/testthat/_snaps/guides/stacked-radial-axes.svg @@ -99,7 +99,7 @@ - + 100 200 300 @@ -108,7 +108,7 @@ - + 100 200 300 @@ -117,7 +117,7 @@ - + @@ -126,7 +126,7 @@ 200 300 400 - + diff --git a/tests/testthat/_snaps/theme/theme-classic-large.svg b/tests/testthat/_snaps/theme/theme-classic-large.svg index 96767cc14f..e1f3f7c793 100644 --- a/tests/testthat/_snaps/theme/theme-classic-large.svg +++ b/tests/testthat/_snaps/theme/theme-classic-large.svg @@ -43,7 +43,7 @@ 1 - + @@ -54,7 +54,7 @@ 2.0 2.5 3.0 - + 1.0 1.5 2.0 diff --git a/tests/testthat/_snaps/theme/theme-classic.svg b/tests/testthat/_snaps/theme/theme-classic.svg index 8588be9819..d1a77a131e 100644 --- a/tests/testthat/_snaps/theme/theme-classic.svg +++ b/tests/testthat/_snaps/theme/theme-classic.svg @@ -43,7 +43,7 @@ 1 - + @@ -54,7 +54,7 @@ 2.0 2.5 3.0 - + 1.0 1.5 2.0