Skip to content

Commit

Permalink
Fix heatmap legend; #4660
Browse files Browse the repository at this point in the history
  • Loading branch information
timoast committed Jul 16, 2021
1 parent 62a43ef commit 93527b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ importFrom(ggplot2,position_jitterdodge)
importFrom(ggplot2,scale_alpha)
importFrom(ggplot2,scale_alpha_ordinal)
importFrom(ggplot2,scale_color_brewer)
importFrom(ggplot2,scale_color_discrete)
importFrom(ggplot2,scale_color_distiller)
importFrom(ggplot2,scale_color_gradient)
importFrom(ggplot2,scale_color_gradientn)
Expand Down
4 changes: 2 additions & 2 deletions R/visualization.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ DimHeatmap <- function(
#'
#' @importFrom stats median
#' @importFrom scales hue_pal
#' @importFrom ggplot2 annotation_raster coord_cartesian scale_color_manual
#' @importFrom ggplot2 annotation_raster coord_cartesian scale_color_discrete
#' ggplot_build aes_string geom_text
#' @importFrom patchwork wrap_plots
#' @export
Expand Down Expand Up @@ -364,7 +364,7 @@ DoHeatmap <- function(
ymax = y.max
) +
coord_cartesian(ylim = c(0, y.max), clip = 'off') +
scale_color_manual(values = cols)
scale_color_discrete(name = "Identity", na.translate = FALSE)
if (label) {
x.max <- max(pbuild$layout$panel_params[[1]]$x.range)
# Attempt to pull xdivs from x.major in ggplot2 < 3.3.0; if NULL, pull from the >= 3.3.0 slot
Expand Down

0 comments on commit 93527b5

Please sign in to comment.