scale_fill_jam | R Documentation |
Apply rainbowJam categorical color fill to a ggplot2 object
scale_fill_jam(
...,
type = "seq",
palette = 1,
direction = 1,
invert = FALSE,
darkFactor = 1,
sFactor = 1,
darken = FALSE,
alpha = 1,
useGrey = 20,
preset = getOption("colorjam.preset", "dichromat2"),
step = getOption("colorjam.step", "default")
)
... |
additional arguments are passed to |
type |
|
palette |
|
direction |
|
invert |
|
darkFactor , sFactor |
|
darken |
|
alpha |
|
useGrey |
|
This function provides a function in the format scale_fill_*
to be applied to ggplot2 objects. It can provide a more visibly
distinct set of categorical colors than ggplot2::scale_fill_hue()
.
Other colorjam ggplot2:
jam_pal()
,
scale_color_jam()
,
theme_jam()
if (jamba::check_pkg_installed("ggplot2")) {
dsamp <- ggplot2::diamonds[sample(nrow(ggplot2::diamonds), 1000),];
d <- ggplot2::ggplot(dsamp,
ggplot2::aes(carat, price)) +
ggplot2::geom_point(
ggplot2::aes(colour=cut, bg=cut),
pch=21,
size=4);
print(d +
scale_color_jam(darkFactor=1.5) +
scale_fill_jam() +
ggplot2::ggtitle("scale_color_jam(darkFactor=1.5) + scale_fill_jam()"));
print(d +
scale_color_jam(darken=TRUE) +
scale_fill_jam() +
ggplot2::ggtitle("scale_color_jam(darkFactor=1.5) + scale_fill_jam()"));
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.