Description Usage Arguments Author(s) Examples
This function can either draw a line in the margin outside each branch
(fill=FALSE
) or color the area underneath a branch (fill=TRUE
).
1 2 |
x |
|
k |
Number of branches to split |
h |
Height at which to split |
fill |
Annotation style, see the details of this function. |
lwd |
Line width, should be pretty large to be clearly visible. |
sector |
See |
col |
Branch colors. If omitted it will be taken from |
alpha |
Opacity values (0 is transparent, 1 is opaque). |
lightness |
Color lightness (0 is the original color, 1 is white, and values in between are interpolated). |
Christofer Bäcklin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | my.data <- iris[-5] + .5*matrix(rnorm(nrow(iris)*(ncol(iris)-1)), nrow(iris))
cl <- hclust(dist(my.data))
x <- polar.clust(cl)
plot(x)
# Color according to class
labels(x) <- sprintf("%s %i", iris$Species, 1:150)
colors(x) <- iris$Species
plot(x, expand=1.2, label.size=.3, las=2)
# Color according to branch
colors(x) <- c(brewer.pal(6, "Set1"))
labels(x) <- NULL # Clear the current labels
labels(x) <- paste("Branch", 1:6)
plot(x, las=1)
# Manual compilation of the plot
s <- c(.4,2.2)*pi
colors(x) <- NULL
plot(x, type="n", labels=FALSE, axes=FALSE, expand=1.1)
branches(x, k=6, sector=s, fill=TRUE, lwd=10, lightness=.3)
lines(x, sector=s)
points(x, pch=19, sector=s)
legend("topright", paste("Branch", 1:6), fill=brewer.pal(6, "Set1"), bg="white")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.