Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add whitespace/gap between column title and first row of the heatmap body #1227

Open
kloot opened this issue Dec 8, 2024 · 0 comments
Open

Comments

@kloot
Copy link

kloot commented Dec 8, 2024

Ho can I add a little whitespace/gap between the column title 'box' (orange, green in the pic below) and the first row of the heatmap body?

I have experimented with ht(opt).
ht_opt("TITLE_PADDING" = unit(c(2, 1), "mm") allows me to adjust the height of the box and the vertical position of the label ('classical monoc') in the box, but ht_opt("COLUMN_ANNO_PADDING") seems to have no effect at all.

The relevant code to generate the heatmap in the (partial) screenshot:

ht_opt(RESET = TRUE)
Heatmap(data, name = "mat",
        row_order = rownames(data),
        row_names_gp = gpar(fontsize = 9),
        
        column_split = split_order %>% select(curated_labels),
        column_order = split_order %>% row.names(),
        column_gap = unit(c(1, 0.5), "mm"),
        show_column_names = FALSE,
        column_title_gp = gpar(fill = c("orange", "forestgreen", "#0033cc"),
                               fontsize = 7),
        border=FALSE,
        ht_opt("HEATMAP_LEGEND_PADDING" = unit(c(5, 5), "mm"),
               "TITLE_PADDING"          = unit(c(2, 1), "mm"), # bottom, top
               "COLUMN_ANNO_PADDING"    = unit(c(30, 10), "mm"),
               "DIMNAME_PADDING"        = unit(1, "mm")        # distance row/column annotation to heatmap  
               )
        )

Many thanks in advance!
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant