Skip to content

Commit d180248

Browse files
Update documentation and example in scale-brewer.R to reflect scale_*_distiller's non-intuitive "direction" (#5381)
* Update scale-brewer.R 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 * Move comment from Details to Note * Document --------- Co-authored-by: yutannihilation <[email protected]>
1 parent c76b9ae commit d180248

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

R/scale-brewer.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
#'
99
#' @note
1010
#' The `distiller` scales extend `brewer` scales by smoothly
11-
#' interpolating 7 colours from any palette to a continuous scale. The `fermenter`
12-
#' scales provide binned versions of the `brewer` scales.
11+
#' interpolating 7 colours from any palette to a continuous scale.
12+
#' The `distiller` scales have a default direction = -1. To reverse, use direction = 1.
13+
#' The `fermenter` scales provide binned versions of the `brewer` scales.
1314
#'
1415
#' @details
1516
#' The `brewer` scales were carefully designed and tested on discrete data.
@@ -75,6 +76,8 @@
7576
#' v
7677
#' v + scale_fill_distiller()
7778
#' v + scale_fill_distiller(palette = "Spectral")
79+
#' # the order of colour can be reversed, but with scale_*_distiller(), the default direction = -1, so to reverse, use direction = 1.
80+
#' v + scale_fill_distiller(palette = "Spectral", direction = 1)
7881
#'
7982
#' # or use blender variants to discretise continuous data
8083
#' v + scale_fill_fermenter()

man/scale_brewer.Rd

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

0 commit comments

Comments
 (0)