ComplexHeatmap icon indicating copy to clipboard operation
ComplexHeatmap copied to clipboard

Jittery text crunched and not bottom-aligned from column_names_rot

Open stanleyrhodes opened this issue 3 years ago • 2 comments

column_names_jitter_000038

The column text is jittery, meaning the individual letters are not bottom-aligned, and some are crunched together. I pasted the small-sized image here for convenience, but I have the same problem on the full-sized image I'm generating.

They look fine in the example in the documentation here: https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html?q=column_names_rot#dimension-names

Although I am using column_names_gp = gpar(fontsize = 8), when I comment it out, the problem remains (here I have also left the column names with underscores to test if the spaces were causing issues--which they weren't):

no_fontsize_colnames_jitter_00003c

Thanks for making this amazing package!

stanleyrhodes avatar Mar 11 '23 19:03 stanleyrhodes

Update: I've been trying to find a way to fix this or get around it, and if I draw() to a png, the text doesn't have this issue. Great! However, the legend in the second draw doesn't seem to be drawn to the png.

png("heatmap_test3.png", width=8, height=11, units="in", res=1200)

draw(ht_list)
draw(lgd, x = unit(27.5, "cm"), y = unit(0.5, "cm"), just = c("left", "bottom"))

dev.off()

stanleyrhodes avatar Mar 12 '23 06:03 stanleyrhodes

This is the plot when you save the plot directly into a png file with small resolutions.

I suggest to save it into PDF instead.

jokergoo avatar Apr 03 '23 10:04 jokergoo