Title: | Pretty Colour Palettes |
---|---|
Description: | Defines aesthetically pleasing colour palettes. |
Authors: | Nicola Rennie [aut, cre] |
Maintainer: | Nicola Rennie <[email protected]> |
License: | CC0 |
Version: | 1.1.0.9002 |
Built: | 2025-01-03 06:45:31 UTC |
Source: | https://github.com/nrennie/prettycols |
Returns a data frame of colorblind friendly colour palettes
colorblind_friendly(palettes = PrettyColsPalettes)
colorblind_friendly(palettes = PrettyColsPalettes)
palettes |
List of palettes. Default PrettyColsPalettes. |
A data frame with two columns giving names and types of colourblind friendly palettes.
colorblind_friendly()
colorblind_friendly()
Returns a data frame of colourblind friendly colour palettes
colourblind_friendly(palettes = PrettyColsPalettes)
colourblind_friendly(palettes = PrettyColsPalettes)
palettes |
List of palettes. Default PrettyColsPalettes. |
A data frame with two columns giving names and types of colourblind friendly palettes.
colourblind_friendly()
colourblind_friendly()
Generates the colour palettes
prettycols(palette, n, type = "discrete", direction = 1)
prettycols(palette, n, type = "discrete", direction = 1)
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 |
A character vector of hex colour codes.
prettycols("Blues")
prettycols("Blues")
Use names(PrettyColsPalettes) to return all palette names.
PrettyColsPalettes
PrettyColsPalettes
An object of class list
of length 46.
Plotting with PrettyCols palettes for colour ggplot2
scale_color_pretty_c(palette, direction = 1, legend_title = NULL, ...)
scale_color_pretty_c(palette, direction = 1, legend_title = NULL, ...)
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 |
A ggproto object defining a continuous colour scale for use with ggplot2.
library(ggplot2) ggplot(data = mtcars, aes(x = mpg, y = disp, color = wt)) + geom_point() + scale_color_pretty_c("Greens")
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
scale_color_pretty_d(palette, direction = 1, legend_title = NULL, ...)
scale_color_pretty_d(palette, direction = 1, legend_title = NULL, ...)
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 |
A ggproto object defining a discrete colour scale for use with ggplot2.
library(ggplot2) ggplot(data = mtcars, aes(x = mpg, y = disp, color = factor(cyl))) + geom_point() + scale_color_pretty_d("Bright")
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
scale_color_pretty_div(palette, direction = 1, legend_title = NULL, ...)
scale_color_pretty_div(palette, direction = 1, legend_title = NULL, ...)
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 |
A ggproto object defining a continuous colour scale for use with ggplot2.
library(ggplot2) ggplot(data = mtcars, aes(x = mpg, y = disp, colour = wt)) + geom_point() + scale_color_pretty_div("PurpleYellows", midpoint = mean(mtcars$wt))
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
scale_colour_pretty_c(palette, direction = 1, legend_title = NULL, ...)
scale_colour_pretty_c(palette, direction = 1, legend_title = NULL, ...)
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 |
A ggproto object defining a continuous colour scale for use with ggplot2.
library(ggplot2) ggplot(data = mtcars, aes(x = mpg, y = disp, colour = wt)) + geom_point() + scale_colour_pretty_c("Greens")
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
scale_colour_pretty_d(palette, direction = 1, legend_title = NULL, ...)
scale_colour_pretty_d(palette, direction = 1, legend_title = NULL, ...)
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 |
A ggproto object defining a discrete colour scale for use with ggplot2.
library(ggplot2) ggplot(data = mtcars, aes(x = mpg, y = disp, colour = factor(cyl))) + geom_point() + scale_colour_pretty_d("Bright")
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
scale_colour_pretty_div(palette, direction = 1, legend_title = NULL, ...)
scale_colour_pretty_div(palette, direction = 1, legend_title = NULL, ...)
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 |
A ggproto object defining a continuous colour scale for use with ggplot2.
library(ggplot2) ggplot(data = mtcars, aes(x = mpg, y = disp, colour = wt)) + geom_point() + scale_colour_pretty_div("PurpleYellows", midpoint = mean(mtcars$wt))
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
scale_fill_pretty_c(palette, direction = 1, legend_title = NULL, ...)
scale_fill_pretty_c(palette, direction = 1, legend_title = NULL, ...)
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 |
A ggproto object defining a continuous fill scale for use with ggplot2.
library(ggplot2) ggplot(data = mtcars, aes(x = mpg, y = disp, fill = wt)) + geom_point(pch = 21) + scale_fill_pretty_c("Greens")
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
scale_fill_pretty_d(palette, direction = 1, legend_title = NULL, ...)
scale_fill_pretty_d(palette, direction = 1, legend_title = NULL, ...)
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 |
A ggproto object defining a discrete fill scale for use with ggplot2.
library(ggplot2) ggplot(data = mtcars, aes(x = mpg, y = disp, fill = factor(cyl))) + geom_point(pch = 21) + scale_fill_pretty_d("Bright")
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
scale_fill_pretty_div(palette, direction = 1, legend_title = NULL, ...)
scale_fill_pretty_div(palette, direction = 1, legend_title = NULL, ...)
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 |
A ggproto object defining a continuous colour scale for use with ggplot2.
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))
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
view_all_palettes(type = "all", colourblind_friendly = FALSE)
view_all_palettes(type = "all", colourblind_friendly = FALSE)
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 |
A plot of all colour palettes available in the package.
view_all_palettes(type = "seq") view_all_palettes(type = c("seq", "div")) view_all_palettes(type = "div", colourblind_friendly = TRUE)
view_all_palettes(type = "seq") view_all_palettes(type = c("seq", "div")) view_all_palettes(type = "div", colourblind_friendly = TRUE)