Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sequential_pal

Sequential palette


Description

This is the ‘OrRd’ palette from https://colorbrewer2.org/. It has at most nine colors.

Usage

sequential_pal(n)

Arguments

n

The number of colors in the palette. The maximum is nine currently.

Details

Use this palette, if vertex colors mark some ordinal quantity, e.g. some centrality measure, or some ordinal vertex covariate, like the age of people, or their seniority level.

Value

A character vector of RGB color codes.

See Also

Other palettes: categorical_pal(), diverging_pal(), r_pal()

Examples

## Not run: 
library(igraphdata)
data(karate)
karate <- karate %>%
  add_layout_(with_kk()) %>%
  set_vertex_attr("size", value = 10)

V(karate)$color <- scales::dscale(degree(karate) %>% cut(5), sequential_pal)
plot(karate)

## End(Not run)

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.