Skip to content

Commit e5d2747

Browse files
Expanded documentation for aes-colour-fill-alpha (#3786)
* added documentation to aes-colour-fill-alpha * copy edit * try to fix link to grDevices::colours(). * clean up see-also section. Co-authored-by: Claus Wilke <[email protected]>
1 parent 49aca36 commit e5d2747

File tree

2 files changed

+91
-6
lines changed

2 files changed

+91
-6
lines changed

R/aes-colour-fill-alpha.r

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,46 @@
1-
#' Colour related aesthetics: colour, fill and alpha
1+
#' Colour related aesthetics: colour, fill, and alpha
22
#'
3-
#' This page demonstrates the usage of a sub-group
4-
#' of aesthetics: colour, fill and alpha.
3+
#' These aesthetics parameters change the colour (`colour` and `fill`) and the
4+
#' opacity (`alpha`) of geom elements on a plot. Almost every geom has either
5+
#' colour or fill (or both), as well as can have their alpha modified.
6+
#' Modifying colour on a plot is a useful way to enhance the presentation of data,
7+
#' often especially when a plot graphs more than two variables.
8+
#'
9+
#' @section Colour and fill:
10+
#'
11+
#' Colours and fills can be specified in the following ways:
12+
#' * A name, e.g., `"red"`. R has 657 built-in named colours, which can be
13+
#' listed with [grDevices::colors()].
14+
#' * An rgb specification, with a string of the form `"#RRGGBB"` where each of the
15+
#' pairs `RR`, `GG`, `BB` consists of two hexadecimal digits giving a value in the
16+
#' range `00` to `FF`. You can optionally make the colour transparent by using the
17+
#' form `"#RRGGBBAA"`.
18+
#' * An `NA`, for a completely transparent colour.
19+
#'
20+
#' @section Alpha:
21+
#'
22+
#' Alpha refers to the opacity of a geom. Values of `alpha` range from 0 to 1,
23+
#' with lower values corresponding to more transparent colors.
24+
#'
25+
#' Alpha can additionally be modified through the `colour` or `fill` aesthetic
26+
#' if either aesthetic provides color values using an rgb specification
27+
#' (`"#RRGGBBAA"`), where `AA` refers to transparency values.
28+
#'
29+
#'
30+
#' @seealso
31+
#' * Other options for modifying colour:
32+
#' [scale_colour_brewer()],
33+
#' [scale_colour_gradient()], [scale_colour_grey()],
34+
#' [scale_colour_hue()], [scale_colour_identity()],
35+
#' [scale_colour_manual()], [scale_colour_viridis_d()]
36+
#' * Other options for modifying fill:
37+
#' [scale_fill_brewer()],
38+
#' [scale_fill_gradient()], [scale_fill_grey()],
39+
#' [scale_fill_hue()], [scale_fill_identity()],
40+
#' [scale_fill_manual()], [scale_fill_viridis_d()]
41+
#' * Other options for modifying alpha: [scale_alpha()]
42+
#' * `vignette("ggplot2-specs")` provides an overview of other aesthestics that
43+
#' can be modified
544
#'
645
#' @name aes_colour_fill_alpha
746
#' @aliases colour color fill

man/aes_colour_fill_alpha.Rd

Lines changed: 49 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)