Skip to content

Commit

Permalink
Update scale-brewer.R
Browse files Browse the repository at this point in the history
Capturing in documentation that scale_*_distiller has a non-intuitive default direction = -1, and that to reverse, user needs to specify direction = 1

Source:
#1439
#4444
  • Loading branch information
ahcyip authored Aug 7, 2023
1 parent da2a8e8 commit 6a113f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/scale-brewer.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#' The `brewer` scales were carefully designed and tested on discrete data.
#' They were not designed to be extended to continuous data, but results often
#' look good. Your mileage may vary.
#' The `distiller` scales have a default direction = -1. To reverse, use direction = 1.
#'
#' @section Palettes:
#' The following palettes are available for use with these scales:
Expand Down Expand Up @@ -75,6 +76,8 @@
#' v
#' v + scale_fill_distiller()
#' v + scale_fill_distiller(palette = "Spectral")
#' # the order of colour can be reversed, but with scale_*_distiller(), the default direction = -1, so to reverse, use direction = 1.
#' v + scale_fill_distiller(palette = "Spectral", direction = 1)
#'
#' # or use blender variants to discretise continuous data
#' v + scale_fill_fermenter()
Expand Down

0 comments on commit 6a113f6

Please sign in to comment.