Skip to content

Commit 5a37ae7

Browse files
brodieGclauswilke
authored andcommitted
Fix #2839: 'continuous_scale' palette param docs (#2840)
closes #2839 * fix 'continuous_scale' palette docs The 'palette' parameter has different usage in continuous vs discrete scales, and the documentation described the discrete usage. * generate Rd files * fix issue with [0,1] getting interpreted
1 parent 4a14027 commit 5a37ae7

10 files changed

+31
-28
lines changed

R/scale-.r

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,9 @@ ScaleDiscrete <- ggproto("ScaleDiscrete", Scale,
499499
#' @export
500500
#' @param aesthetics The names of the aesthetics that this scale works with
501501
#' @param scale_name The name of the scale
502-
#' @param palette A palette function that when called with a single integer
503-
#' argument (the number of levels in the scale) returns the values that
504-
#' they should take
502+
#' @param palette A palette function that when called with a numeric vector with
503+
#' values between 0 and 1 returns the corresponding values in the range the
504+
#' scale maps to.
505505
#' @param name The name of the scale. Used as the axis or legend title. If
506506
#' `waiver()`, the default, the name of the scale is taken from the first
507507
#' mapping used for that aesthetic. If `NULL`, the legend title will be
@@ -600,6 +600,9 @@ continuous_scale <- function(aesthetics, scale_name, palette, name = waiver(),
600600
#'
601601
#' @export
602602
#' @inheritParams continuous_scale
603+
#' @param palette A palette function that when called with a single integer
604+
#' argument (the number of levels in the scale) returns the values that
605+
#' they should take.
603606
#' @param breaks One of:
604607
#' - `NULL` for no breaks
605608
#' - `waiver()` for the default breaks computed by the

man/continuous_scale.Rd

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

man/discrete_scale.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/scale_discrete.Rd

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

man/scale_gradient.Rd

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

man/scale_grey.Rd

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

man/scale_hue.Rd

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

man/scale_linetype.Rd

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

man/scale_manual.Rd

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

man/scale_shape.Rd

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

0 commit comments

Comments
 (0)