Browse code

do not adjust cols when rect_gp = gpar(type='none')

Zuguang Gu authored on 19/05/2022 19:54:44
Showing 1 changed files

... ...
@@ -559,7 +559,7 @@ Heatmap = function(matrix, col, name,
559 559
             warning_wrap("You defined `cell_fun` for a heatmap with more than 100 rows or columns, which might be very slow to draw. Consider to use the vectorized version `layer_fun`.")
560 560
         }
561 561
     }
562
-    
562
+
563 563
     ### color for main matrix #########
564 564
     if(ncol(matrix) > 0 && nrow(matrix) > 0) {
565 565
         if(missing(col)) {
... ...
@@ -625,7 +625,7 @@ Heatmap = function(matrix, col, name,
625 625
                 } else {
626 626
                     col = col[intersect(c(fa_level, "_NA_"), names(col))]
627 627
                 }
628
-                if(!is.null(heatmap_legend_param)) {
628
+                if(!is.null(heatmap_legend_param) && !identical(.Object@matrix_param$gp$type, "none")) {
629 629
                     if(!is.null(heatmap_legend_param$at) && !is.null(heatmap_legend_param$labels)) {
630 630
                         l = heatmap_legend_param$at %in% names(col)
631 631
                         heatmap_legend_param$at = heatmap_legend_param$at[l]