diff --git a/NEWS.md b/NEWS.md index 3cfd6b71e6..956f448394 100644 --- a/NEWS.md +++ b/NEWS.md @@ -137,6 +137,9 @@ stats, facets and coords (#3329, @teunbrand) `guides(x = guide_axis(position = "top"))` will display the title at the top by default (#4650). +* The default `vjust` for the `axis.title.y.right` element is now 1 instead of + 0. + * Unknown secondary axis guide positions are now inferred as the opposite of the primary axis guide when the latter has a known `position` (#4650). diff --git a/R/theme-defaults.R b/R/theme-defaults.R index e9436acfb9..40e65cb19e 100644 --- a/R/theme-defaults.R +++ b/R/theme-defaults.R @@ -164,7 +164,7 @@ theme_grey <- function(base_size = 11, base_family = "", axis.title.y.right = element_text( angle = -90, margin = margin(l = half_line / 2), - vjust = 0 + vjust = 1 ), legend.background = element_rect(colour = NA), @@ -569,7 +569,7 @@ theme_test <- function(base_size = 11, base_family = "", axis.title.y.right = element_text( angle = -90, margin = margin(l = half_line / 2), - vjust = 0 + vjust = 1 ), legend.background = element_rect(colour = NA), diff --git a/tests/testthat/_snaps/coord-map/coord-map-switched-scale-position.svg b/tests/testthat/_snaps/coord-map/coord-map-switched-scale-position.svg index 7a7cf9889c..9490c73c5b 100644 --- a/tests/testthat/_snaps/coord-map/coord-map-switched-scale-position.svg +++ b/tests/testthat/_snaps/coord-map/coord-map-switched-scale-position.svg @@ -68,7 +68,7 @@ 45 50 long -lat +lat coord_map switched scale position diff --git a/tests/testthat/_snaps/coord-polar/secondary-axis-ticks-and-labels.svg b/tests/testthat/_snaps/coord-polar/secondary-axis-ticks-and-labels.svg index 3e0228e8dc..29d0d4dc47 100644 --- a/tests/testthat/_snaps/coord-polar/secondary-axis-ticks-and-labels.svg +++ b/tests/testthat/_snaps/coord-polar/secondary-axis-ticks-and-labels.svg @@ -61,7 +61,7 @@ 0.30 x y -sec y +sec y secondary axis ticks and labels diff --git a/tests/testthat/_snaps/coord-transform/sec-axis-with-coord-trans.svg b/tests/testthat/_snaps/coord-transform/sec-axis-with-coord-trans.svg index ec428f81e0..9a94eed9ae 100644 --- a/tests/testthat/_snaps/coord-transform/sec-axis-with-coord-trans.svg +++ b/tests/testthat/_snaps/coord-transform/sec-axis-with-coord-trans.svg @@ -311,7 +311,7 @@ cty cty hwy -log2(hwy) +log2(hwy) sec_axis with coord_trans() diff --git a/tests/testthat/_snaps/coord_sf/coord-sf-with-custom-guides.svg b/tests/testthat/_snaps/coord_sf/coord-sf-with-custom-guides.svg index 8447a9d8d5..b38125acd3 100644 --- a/tests/testthat/_snaps/coord_sf/coord-sf-with-custom-guides.svg +++ b/tests/testthat/_snaps/coord_sf/coord-sf-with-custom-guides.svg @@ -130,7 +130,7 @@ N guide_none() with title title from scale -Secondary guide via `guides()` +Secondary guide via `guides()` coord_sf() with custom guides diff --git a/tests/testthat/_snaps/guides/guide-axis-customization.svg b/tests/testthat/_snaps/guides/guide-axis-customization.svg index 0b082ad619..8bce541c00 100644 --- a/tests/testthat/_snaps/guides/guide-axis-customization.svg +++ b/tests/testthat/_snaps/guides/guide-axis-customization.svg @@ -292,7 +292,7 @@ subcompact class hwy -hwy +hwy guide_axis() customization diff --git a/tests/testthat/_snaps/guides/guide-titles-with-coord-trans.svg b/tests/testthat/_snaps/guides/guide-titles-with-coord-trans.svg index bfe8ec8a98..4a658436f4 100644 --- a/tests/testthat/_snaps/guides/guide-titles-with-coord-trans.svg +++ b/tests/testthat/_snaps/guides/guide-titles-with-coord-trans.svg @@ -74,7 +74,7 @@ x (secondary) x (primary) y (primary) -y (secondary) +y (secondary) guide titles with coord_trans() diff --git a/tests/testthat/_snaps/guides/logtick-axes-with-customisation.svg b/tests/testthat/_snaps/guides/logtick-axes-with-customisation.svg index 8ad941b27d..ec99938f19 100644 --- a/tests/testthat/_snaps/guides/logtick-axes-with-customisation.svg +++ b/tests/testthat/_snaps/guides/logtick-axes-with-customisation.svg @@ -200,7 +200,7 @@ Negative length pseudo-logticks with 0.1 as smallest tick Pseudo-logticks with 1 as smallest tick Inverted logticks with swapped tick lengths -Capped and not-expanded inverted logticks +Capped and not-expanded inverted logticks logtick axes with customisation diff --git a/tests/testthat/_snaps/guides/position-guide-titles.svg b/tests/testthat/_snaps/guides/position-guide-titles.svg index 7e836db38d..51c1f1c527 100644 --- a/tests/testthat/_snaps/guides/position-guide-titles.svg +++ b/tests/testthat/_snaps/guides/position-guide-titles.svg @@ -34,7 +34,7 @@ x (secondary) x (primary) y (primary) -y (secondary) +y (secondary) position guide titles diff --git a/tests/testthat/_snaps/guides/stacked-axes.svg b/tests/testthat/_snaps/guides/stacked-axes.svg index 6d66656927..9ed86845f6 100644 --- a/tests/testthat/_snaps/guides/stacked-axes.svg +++ b/tests/testthat/_snaps/guides/stacked-axes.svg @@ -142,7 +142,7 @@ top bottom left -right +right stacked axes diff --git a/tests/testthat/_snaps/guides/stacked-radial-axes.svg b/tests/testthat/_snaps/guides/stacked-radial-axes.svg index 240e16d958..18609a9a74 100644 --- a/tests/testthat/_snaps/guides/stacked-radial-axes.svg +++ b/tests/testthat/_snaps/guides/stacked-radial-axes.svg @@ -137,7 +137,7 @@ 400 hp left -right +right stacked radial axes diff --git a/tests/testthat/_snaps/sec-axis/sec-axis-monotonicity-test.svg b/tests/testthat/_snaps/sec-axis/sec-axis-monotonicity-test.svg index 98c4304d47..abf6775b7f 100644 --- a/tests/testthat/_snaps/sec-axis/sec-axis-monotonicity-test.svg +++ b/tests/testthat/_snaps/sec-axis/sec-axis-monotonicity-test.svg @@ -79,7 +79,7 @@ 1.00 x y -y +y sec axis monotonicity test diff --git a/tests/testthat/_snaps/sec-axis/sec-axis-with-division.svg b/tests/testthat/_snaps/sec-axis/sec-axis-with-division.svg index e3105aa3cd..9527441ed0 100644 --- a/tests/testthat/_snaps/sec-axis/sec-axis-with-division.svg +++ b/tests/testthat/_snaps/sec-axis/sec-axis-with-division.svg @@ -309,7 +309,7 @@ 7 displ hwy -100km / L +100km / L sec_axis, with division diff --git a/tests/testthat/_snaps/theme/axes-styling.svg b/tests/testthat/_snaps/theme/axes-styling.svg index 35e016656f..345db8bb68 100644 --- a/tests/testthat/_snaps/theme/axes-styling.svg +++ b/tests/testthat/_snaps/theme/axes-styling.svg @@ -94,7 +94,7 @@ 1:10 1:10 1:10 -1:10 +1:10 axes_styling diff --git a/tests/testthat/_snaps/theme/ticks-length.svg b/tests/testthat/_snaps/theme/ticks-length.svg index 898b83062b..08b3a1a841 100644 --- a/tests/testthat/_snaps/theme/ticks-length.svg +++ b/tests/testthat/_snaps/theme/ticks-length.svg @@ -75,7 +75,7 @@ 1:10 1:10 1:10 -1:10 +1:10 ticks_length