stack_discrete("h", matrix(1:9, nrow = 3L)) +
ggheatmap() +
# ggheamtap will set the active context, directing following addition
# into the heatmap plot area. To remove the heatmap active context,
# we can use `stack_active()` which will direct subsequent addition into
# the stack
stack_active() +
# here we add a dendrogram to the stack.
align_dendro()
Run the code above in your browser using DataLab