Closed Frankshi5011 closed 3 years ago
This is the best I can get, but I could not figure out how to replace the "anno" with gene names, which is a string in Trackplot_genes[I]. The following code can plot the figure I want, but I can not label the rows with gene names. Any suggestion? Thank you very much.
`Hm_list = NULL for (i in 1:length(Trackplot_genes)) { heatmap = HeatmapAnnotation(anno = anno_barplot(merge_data[, i+3], border = FALSE, height = unit(1, "cm"),axis_param = list (at=(c(0,max(as.vector (merge_data[, i+3]))))), gp = gpar (col= Trackplot_color[i])), annotation_name_gp = (gpar (col =Trackplot_color[i], fontsize=12, fontface = c("italic", "bold")))) Hm_list = Hm_list %v% heatmap } Hm_list = Hm_list %v% HeatmapAnnotation(Clusters=merge_data$seurat_clusters, col = list(Clusters = c ("0"="#F8766D","1"="#DE8C00","2"= "#B79F00","3"= "#7CAE00","4"= "#00BA38","5"= "#00C08B","6"= "#00BFC4","7"= "#00B4F0", "8"= "#619CFF","9"= "#C77CFF","10"= "#F564E3","11"= "#FF64B0")), show_annotation_name = TRUE)
tiff(filename = "test.tiff", width = 320, height = 320, units = "mm", res = 300, pointsize = 3.0) draw (Hm_list) dev.off()`
annotation_label did the trick.
Hi, there, I am trying to plot a stacked barplot using the following code. I want to simplify it with a for loop. How can I name the anno_barplot() in the for loop? test.pdf Thank you for your help.