Skip to content

Instantly share code, notes, and snippets.

@atongsa
Last active November 17, 2022 02:25
Show Gist options
  • Save atongsa/5d9af75080eee0738c7c3468331a0b7d to your computer and use it in GitHub Desktop.
Save atongsa/5d9af75080eee0738c7c3468331a0b7d to your computer and use it in GitHub Desktop.
add rectangle to your complexheatmap body
library(ComplexHeatmap)
pdf('test.pdf')
ht1 <- Heatmap(mat, name="ht1")
a <- draw(ht1)
decorate_heatmap_body("ht1", {
grid.rect(x=0.5, y=0.6, width=0.2, height=0.5, gp = gpar(lty = 2, lwd = 2))
})
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment