ComplexHeatmap
ComplexHeatmap copied to clipboard
Oncoprint - color top, center and bottom third of rectange
Please provide example datasets and the code you use. It will help me to understand your problem and help you!
Hi, I am trying to generate an oncoprint like below. How can I color each third of the rectangle, should I be using grid.polygon? I know how to conditionally color, just need to figure out how to draw the smaller rectanges.
Thanks, MS
When you define the alter_fun
, you can do:
alter_fun = list(
some_name = function(x, y, w, h) {
# y - 0.5*h corresponds to the bottom of each cell
# 1/3*h is the height which is 1/3 of the cell height
# `just` controls how to draw the small rectangles
grid.rect(x, y - 0.5*h, width = w, height = 1/3*h, just = "bottom", gp = gpar(fill = "blue")
},
....
)
Great, thank you, that works perfectly.