| mal_pal | R Documentation |
The list of available palettes is:
mal_pal
An object of class list of length 15.
ncezid niosh ncrid usaid pmi_desert pmi_bg sunset miami_vice purple_rain aladdin_sane sgt_pepper hello_nasty ok_computer los_angeles
# Make an x-y plot using the Namatjira palette
library(tidyverse)
df <- data.frame(x = rnorm(100, 0, 20),
y = rnorm(100, 0, 20),
cl = sample(letters[1:8], 100, replace=TRUE))
ggplot(df, aes(x, y, colour=cl, shape=cl)) +
geom_point(size=4) + scale_colour_ochre() +
theme_bw() + theme(aspect.ratio=1)
# Make a histogram using the McCrea Collins Street palette
ggplot(df, aes(x, fill=cl)) + geom_histogram() +
scale_fill_ochre(palette="mccrea")
## Not run:
data(elev)
library(elevatr)
library(raster)
library(ochRe)
colpal <- ochre_pal()(150)
ex <- extent(110, 155, -45, -10)
elev <- raster::crop(elev, ex)
elev[elev < 0] <- NA
topo <- list(x = xFromCol(elev), y = rev(yFromRow(elev)),
z = t(as.matrix(elev))[, nrow(elev):1])
par(mar = rep(0, 4), bg = "#444444")
image(topo, useRaster = TRUE, col = colpal,
axes = FALSE, xlab = "", ylab = "",
asp = cos(27.5 * pi/180))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.