tests/test-multiple-page.R

library(circlize)
library(ComplexHeatmap)
library(GetoptLong)

m = matrix(rnorm(100), 10)

postscript("test.ps")
lgd = Legend(labels = c("a", "b", "c"))
draw(Heatmap(m), heatmap_legend_list = list(lgd))
dev.off()

check_pages = function() {
	lines = readLines("test.ps")
	print(lines[length(lines)-1])
	invisible(file.remove("test.ps"))
}

check_pages()

postscript("test.ps")
ha = HeatmapAnnotation(foo = 1:10, bar = anno_points(1:10))
Heatmap(m, top_annotation = ha)
dev.off()

check_pages()
jokergoo/ComplexHeatmap documentation built on Nov. 17, 2023, 11:27 a.m.