Skip to content

Commit f94904a

Browse files
authored
Document guide_colourbar() ticks behaviour (#6660)
* document tick behaviour * include different ticks in pre-existing test
1 parent 0a60186 commit f94904a

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

R/guide-colorbar.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ NULL
4545
#' @param available_aes A vector of character strings listing the aesthetics
4646
#' for which a colourbar can be drawn.
4747
#' @param ... ignored.
48+
#' @details
49+
#' The `legend.ticks.length` theme option can be set to a length 2 unit to
50+
#' control ticks at the right/bottom and left/top sides independently.
51+
#'
4852
#' @return A guide object
4953
#' @export
5054
#' @family guides

man/guide_colourbar.Rd

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/_snaps/guide-colorbar/customized-colorbar.svg

Lines changed: 5 additions & 5 deletions
Loading

tests/testthat/test-guide-colorbar.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ test_that("colorbar can be styled", {
7878
theme = theme(
7979
legend.frame = element_rect(colour = "green", linewidth = 1.5 / .pt),
8080
legend.ticks = element_line("black", linewidth = 2.5 / .pt),
81-
legend.ticks.length = unit(0.4, "npc")
81+
legend.ticks.length = unit(c(0.2, 0.4), "npc")
8282
), alpha = 0.75
8383
)
8484
) + labs(subtitle = "white-to-red semitransparent colorbar, long thick black ticks, green frame")

0 commit comments

Comments
 (0)