# Giving vectors directly
key_segment_manual(
value = 0:1, value_end = 2:3,
oppo = 1:0, oppo_end = 3:2
)
# Taking columns of a data frame
data <- data.frame(x = 0:1, y = 1:0, xend = 2:3, yend = 3:2)
key_segment_map(data, value = x, oppo = y, value_end = xend, oppo_end = yend)
# Using dendrogram data
clust <- hclust(dist(USArrests), "ave")
key_dendro(clust)(scale_x_discrete())
Run the code above in your browser using DataLab