|
1 |
| -#' Colour related aesthetics: colour, fill and alpha |
| 1 | +#' Colour related aesthetics: colour, fill, and alpha |
2 | 2 | #'
|
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 |
5 | 44 | #'
|
6 | 45 | #' @name aes_colour_fill_alpha
|
7 | 46 | #' @aliases colour color fill
|
|
0 commit comments