hc <- hclust(dist(USArrests), "ave")
dend1 <- as.dendrogram(hc)
dend2 <- cut(dend1, h=70)



dendpanel <- function(x, y, subscripts, ...) {
  pushViewport(viewport(gp=gpar(fontsize=8)),
               viewport(y=unit(0.95, "npc"), 
                        height=unit(0.95, "npc"),
                        just="top"))
  grid.echo(function() {
                par(mar=c(5.1, 0, 1, 0))
                plot(dend2$lower[[subscripts]], axes=FALSE)
            },
            newpage=FALSE, 
            prefix=paste0("dend-", panel.number()))
  popViewport(2)
}


xyplot(y ~ x | height, subscripts=TRUE, 
       xlab="", ylab="",
       strip=strip.custom(style=4), 
       scales=list(draw=FALSE), 
       panel=dendpanel)


