The scale_colour_fermenter() function is used to set the colors for a plot using a palette from the Fermenter package.
Syntax
scale_fill_fermenter(
type = "seq",
palette = 1,
direction = -1,
na.value = "grey50",
guide = "coloursteps",
aesthetics = "fill"
)
Parameters
- type: It is one of “seq” (sequential), “div” (diverging), or “qual” (qualitative)
- palette: If a string will use that named palette. If a number is indexed into the list of palettes of the appropriate type. The list of available palettes can be found in the Palettes section.
- direction: It sets the order of colors in the scale. If 1, the default colors are as output by RColorBrewer::brewer.pal(). If -1, the order of colors is reversed.
- aesthetics: The character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with.
- na.value: It is a color for missing values
- guide: Type of legend. Use “colourbar” for continuous color bar or “legend” for discrete color legend.
Example
library(ggplot2)
# Create a scatterplot of mpg vs. hp, with points colored
# by the number of cylinders
p <- ggplot(mtcars, aes(x = hp, y = mpg, colour = cyl)) +
geom_point()
# Adjust the color of the points using the
# scale_colour_fermenter() function
p + scale_colour_fermenter(palette = 1, name = "Cylinders")
Output
Related posts

Krunal Lathiya is a seasoned Computer Science expert with over eight years in the tech industry. He boasts deep knowledge in Data Science and Machine Learning. Versed in Python, JavaScript, PHP, R, and Golang. Skilled in frameworks like Angular and React and platforms such as Node.js. His expertise spans both front-end and back-end development. His proficiency in the Python language stands as a testament to his versatility and commitment to the craft.