Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions R/guide-colorbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ NULL
#' @param available_aes A vector of character strings listing the aesthetics
#' for which a colourbar can be drawn.
#' @param ... ignored.
#' @details
#' The `legend.ticks.length` theme option can be set to a length 2 unit to
#' control ticks at the right/bottom and left/top sides independently.
#'
#' @return A guide object
#' @export
#' @family guides
Expand Down
3 changes: 3 additions & 0 deletions man/guide_colourbar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions tests/testthat/_snaps/guide-colorbar/customized-colorbar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/test-guide-colorbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ test_that("colorbar can be styled", {
theme = theme(
legend.frame = element_rect(colour = "green", linewidth = 1.5 / .pt),
legend.ticks = element_line("black", linewidth = 2.5 / .pt),
legend.ticks.length = unit(0.4, "npc")
legend.ticks.length = unit(c(0.2, 0.4), "npc")
), alpha = 0.75
)
) + labs(subtitle = "white-to-red semitransparent colorbar, long thick black ticks, green frame")
Expand Down
Loading