Title: | Pretty Colour Palettes |
Version: | 1.1.0 |
Description: | Defines aesthetically pleasing colour palettes. |
License: | CC0 |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.1 |
Depends: | R (≥ 3.6) |
Imports: | ggplot2, graphics, grDevices, lifecycle |
Suggests: | covr, knitr, markdown, rmarkdown, testthat (≥ 3.0.0) |
Config/Needs/website: | nrennie/nrenniepkgdown |
URL: | https://nrennie.rbind.io/PrettyCols/, https://github.com/nrennie/PrettyCols |
BugReports: | https://github.com/nrennie/PrettyCols/issues |
VignetteBuilder: | knitr |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2024-06-19 20:42:40 UTC; rennien2 |
Author: | Nicola Rennie [aut, cre] |
Maintainer: | Nicola Rennie <nrennie35@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-06-19 21:10:02 UTC |
PrettyCols: Pretty Colour Palettes
Description
Defines aesthetically pleasing colour palettes.
Author(s)
Maintainer: Nicola Rennie nrennie35@gmail.com
See Also
Useful links:
Report bugs at https://github.com/nrennie/PrettyCols/issues
Complete list of palettes.
Description
Use names(PrettyColsPalettes) to return all palette names.
Usage
PrettyColsPalettes
Format
An object of class list
of length 40.
Returns a data frame of colorblind friendly colour palettes
Description
Returns a data frame of colorblind friendly colour palettes
Usage
colorblind_friendly(palettes = PrettyColsPalettes)
Arguments
palettes |
List of palettes. Default PrettyColsPalettes. |
Value
A data frame with two columns giving names and types of colourblind friendly palettes.
Examples
colorblind_friendly()
Returns a data frame of colourblind friendly colour palettes
Description
Returns a data frame of colourblind friendly colour palettes
Usage
colourblind_friendly(palettes = PrettyColsPalettes)
Arguments
palettes |
List of palettes. Default PrettyColsPalettes. |
Value
A data frame with two columns giving names and types of colourblind friendly palettes.
Examples
colourblind_friendly()
Generates the colour palettes
Description
Generates the colour palettes
Usage
prettycols(palette, n, type = "discrete", direction = 1)
Arguments
palette |
Name of Palette. Run |
n |
Number of desired colors. If number of requested colors is beyond the scope of the palette, colors are automatically interpolated. If n is not provided, the length of the palette is used. |
type |
Either "continuous" or "discrete". Use continuous if you want to automatically interpolate between colors. Default "discrete" |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
Value
A character vector of hex colour codes.
Examples
prettycols("Blues")
Plotting with PrettyCols palettes for colour ggplot2
Description
Plotting with PrettyCols palettes for colour ggplot2
Usage
scale_color_pretty_c(palette, direction = 1, legend_title = NULL, ...)
Arguments
palette |
Name of Palette. Run |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
legend_title |
|
... |
Other arguments passed on to |
Value
A ggproto object defining a continuous colour scale for use with ggplot2.
Examples
library(ggplot2)
ggplot(data = mtcars, aes(x = mpg, y = disp, color = wt)) +
geom_point() +
scale_color_pretty_c("Greens")
Plotting with PrettyCols palettes for colour ggplot2
Description
Plotting with PrettyCols palettes for colour ggplot2
Usage
scale_color_pretty_d(palette, direction = 1, legend_title = NULL, ...)
Arguments
palette |
Name of Palette. Run |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
legend_title |
|
... |
Other arguments passed on to |
Value
A ggproto object defining a discrete colour scale for use with ggplot2.
Examples
library(ggplot2)
ggplot(data = mtcars, aes(x = mpg, y = disp, color = factor(cyl))) +
geom_point() +
scale_color_pretty_d("Bright")
Plotting with PrettyCols palettes for colour ggplot2
Description
Plotting with PrettyCols palettes for colour ggplot2
Usage
scale_color_pretty_div(palette, direction = 1, legend_title = NULL, ...)
Arguments
palette |
Name of Palette. Run |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
legend_title |
|
... |
Other arguments passed on to |
Value
A ggproto object defining a continuous colour scale for use with ggplot2.
Examples
library(ggplot2)
ggplot(data = mtcars, aes(x = mpg, y = disp, colour = wt)) +
geom_point() +
scale_color_pretty_div("PurpleYellows", midpoint = mean(mtcars$wt))
Plotting with PrettyCols palettes for colour ggplot2
Description
Plotting with PrettyCols palettes for colour ggplot2
Usage
scale_colour_pretty_c(palette, direction = 1, legend_title = NULL, ...)
Arguments
palette |
Name of Palette. Run |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
legend_title |
|
... |
Other arguments passed on to |
Value
A ggproto object defining a continuous colour scale for use with ggplot2.
Examples
library(ggplot2)
ggplot(data = mtcars, aes(x = mpg, y = disp, colour = wt)) +
geom_point() +
scale_colour_pretty_c("Greens")
Plotting with PrettyCols palettes for colour ggplot2
Description
Plotting with PrettyCols palettes for colour ggplot2
Usage
scale_colour_pretty_d(palette, direction = 1, legend_title = NULL, ...)
Arguments
palette |
Name of Palette. Run |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
legend_title |
|
... |
Other arguments passed on to |
Value
A ggproto object defining a discrete colour scale for use with ggplot2.
Examples
library(ggplot2)
ggplot(data = mtcars, aes(x = mpg, y = disp, colour = factor(cyl))) +
geom_point() +
scale_colour_pretty_d("Bright")
Plotting with PrettyCols palettes for colour ggplot2
Description
Plotting with PrettyCols palettes for colour ggplot2
Usage
scale_colour_pretty_div(palette, direction = 1, legend_title = NULL, ...)
Arguments
palette |
Name of Palette. Run |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
legend_title |
|
... |
Other arguments passed on to |
Value
A ggproto object defining a continuous colour scale for use with ggplot2.
Examples
library(ggplot2)
ggplot(data = mtcars, aes(x = mpg, y = disp, colour = wt)) +
geom_point() +
scale_colour_pretty_div("PurpleYellows", midpoint = mean(mtcars$wt))
Plotting with PrettyCols palettes for colour ggplot2
Description
Plotting with PrettyCols palettes for colour ggplot2
Usage
scale_fill_pretty_c(palette, direction = 1, legend_title = NULL, ...)
Arguments
palette |
Name of Palette. Run |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
legend_title |
|
... |
Other arguments passed on to |
Value
A ggproto object defining a continuous fill scale for use with ggplot2.
Examples
library(ggplot2)
ggplot(data = mtcars, aes(x = mpg, y = disp, fill = wt)) +
geom_point(pch = 21) +
scale_fill_pretty_c("Greens")
Plotting with PrettyCols palettes for colour ggplot2
Description
Plotting with PrettyCols palettes for colour ggplot2
Usage
scale_fill_pretty_d(palette, direction = 1, legend_title = NULL, ...)
Arguments
palette |
Name of Palette. Run |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
legend_title |
|
... |
Other arguments passed on to |
Value
A ggproto object defining a discrete fill scale for use with ggplot2.
Examples
library(ggplot2)
ggplot(data = mtcars, aes(x = mpg, y = disp, fill = factor(cyl))) +
geom_point(pch = 21) +
scale_fill_pretty_d("Bright")
Plotting with PrettyCols palettes for fill colour ggplot2
Description
Plotting with PrettyCols palettes for fill colour ggplot2
Usage
scale_fill_pretty_div(palette, direction = 1, legend_title = NULL, ...)
Arguments
palette |
Name of Palette. Run |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
legend_title |
|
... |
Other arguments passed on to |
Value
A ggproto object defining a continuous colour scale for use with ggplot2.
Examples
library(ggplot2)
ggplot(data = mtcars, aes(x = mpg, y = disp, fill = wt)) +
geom_point(pch = 21) +
scale_fill_pretty_div("PurpleYellows", midpoint = mean(mtcars$wt))
Prints all available colour palettes
Description
Prints all available colour palettes
Usage
view_all_palettes(type = "all", colourblind_friendly = FALSE)
Arguments
type |
Type of colour palettes to view. Either all palettes, sequential palettes, diverging palettes, or qualitative palettes. Types must be at least one of c("all", "seq", "div", "qual"). Default "all". |
colourblind_friendly |
Boolean whether or not to return only colourblind friendly
palettes. Default |
Value
A plot of all colour palettes available in the package.
Examples
view_all_palettes(type = "seq")
view_all_palettes(type = c("seq", "div"))
view_all_palettes(type = "div", colourblind_friendly = TRUE)