forked from satijalab/seurat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomPalette.Rd
46 lines (36 loc) · 1.13 KB
/
CustomPalette.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualization.R
\name{BlackAndWhite}
\alias{BlackAndWhite}
\alias{BlueAndRed}
\alias{CustomPalette}
\alias{PurpleAndYellow}
\title{Create a custom color palette}
\usage{
BlackAndWhite(mid = NULL, k = 50)
BlueAndRed(k = 50)
CustomPalette(low = "white", high = "red", mid = NULL, k = 50)
PurpleAndYellow(k = 50)
}
\arguments{
\item{mid}{middle color. Optional.}
\item{k}{number of steps (colors levels) to include between low and high values}
\item{low}{low color}
\item{high}{high color}
}
\value{
A color palette for plotting
}
\description{
Creates a custom color palette based on low, middle, and high color values
}
\examples{
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlackAndWhite())
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlueAndRed())
myPalette <- CustomPalette()
myPalette
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = PurpleAndYellow())
}