Skip to contents

Plots a sankey diagram with gradient colors, based on geom_ribbon

Usage

plot_sankeygradient(
  column_from,
  column_to,
  color_from,
  color_to,
  values,
  padding = 2,
  alpha = 0.4,
  display_labels = TRUE,
  match_label_color = TRUE,
  label_fontface = "bold",
  label_size = 10
)

Arguments

column_from

vector of character labels, indicating the lefthand side

column_to

vector of character labels, indicating the righthand side

color_from

vector of color values, indicating colors for the lefthand side

color_to

vector of color values, indicating colors for the righthand side

values

vector of values, indicating the width of the ribbon

padding

constant used for displaying space between ribbons

alpha

numeric, transparancy of colors (0 = complete transparent, 1 = opaque)

display_labels

boolean used for displaying labels or not

match_label_color

boolean used to indicate labels in same color as nodes

label_fontface

string used for styling the font of labels

label_size

number indicating the font size of labels

Value

a ggplot with geom_ribbons

Examples

if (FALSE) { # \dontrun{
plot_sankeygradient(column_from = c("a","b"),
                   column_to = c("d","d"),
                   values = c(5,10),
                   color_from = c("red", "green"),
                   color_to = c("blue", "blue"))
} # }