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_numbers parameter is invalid #1216

Open
yrjia1015 opened this issue Nov 5, 2024 · 0 comments
Open

add_numbers parameter is invalid #1216

yrjia1015 opened this issue Nov 5, 2024 · 0 comments

Comments

@yrjia1015
Copy link

Please provide example datasets and the code you use. It will help me to understand your problem and help you!
Thank you for developing this powerful tool. When I use anno'barplot to add annotations, if the input value is a matrix, it will be a stacked bar chart. But the add_numbers parameter will no longer work. Is there any other way to display values when using stacked bar charts for annotation?

`library(ComplexHeatmap)
library(grid)

set.seed(123)

mat = matrix(rnorm(100), 10)
rownames(mat) = paste0("R", 1:10)
colnames(mat) = paste0("C", 1:10)

column_ha = HeatmapAnnotation(
foo1 = runif(10),
bar1 = anno_barplot(matrix(nc = 2, c(1:10, 10:1)), add_numbers = TRUE,gp = gpar(fill = c("#ECD9E1", "#2F4E68")))
)

row_ha = rowAnnotation(
foo2 = runif(10),
add_numbers = TRUE,
bar2 = anno_barplot(runif(10), gp = gpar(fill = "#ef9f54"))
)

ht = Heatmap(mat, name = "mat", top_annotation = column_ha, right_annotation = row_ha)

ht_drawn = draw(ht)

`

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