Skip to content

Instantly share code, notes, and snippets.

@jokergoo
Created April 16, 2020 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jokergoo/ac65ed4061c83fe26a4a3e182c9cb6f9 to your computer and use it in GitHub Desktop.
Save jokergoo/ac65ed4061c83fe26a4a3e182c9cb6f9 to your computer and use it in GitHub Desktop.
add asterisks on heatmap
library(circlize)
library(ComplexHeatmap)
mat = matrix(runif(100), 10)
col_fun = colorRamp2(c(0, 0.1, 1), c("blue", "white", "red"))
Heatmap(mat, col = col_fun, cell_fun = function(j, i, x, y, w, h, fill) {
if(mat[i, j] < 0.1) {
grid.text("*", x, y)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment