Skip to content

Commit

Permalink
Reduce the gap between dendrogram and headmap in explanatory heatmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
jasenfinch committed Sep 12, 2023
1 parent c2a46a3 commit f26523a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ importFrom(ggplot2,scale_fill_gradient)
importFrom(ggplot2,scale_fill_gradient2)
importFrom(ggplot2,scale_fill_manual)
importFrom(ggplot2,scale_shape_manual)
importFrom(ggplot2,scale_x_discrete)
importFrom(ggplot2,scale_x_reverse)
importFrom(ggplot2,scale_y_continuous)
importFrom(ggplot2,scale_y_discrete)
Expand Down
5 changes: 3 additions & 2 deletions R/plotExplanatoryHeatmap.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @importFrom ggplot2 ggplot theme scale_y_discrete
#' @importFrom ggplot2 ggplot theme scale_y_discrete scale_x_discrete
#' @importFrom ggplot2 geom_segment scale_x_reverse scale_y_continuous unit

heatmapClasses <- function(pl,
Expand Down Expand Up @@ -76,6 +76,7 @@ heatmapClasses <- function(pl,
geom_tile(colour = 'black') +
scale_fill_gradient(low = low, high = high,limits=c(0,100)) +
scale_y_discrete(expand = c(0,0),position = 'right') +
scale_x_discrete(expand = c(0,0)) +
theme_minimal(base_size = 8) +
labs(title = title,
fill = 'Percent\nIntensity')
Expand Down Expand Up @@ -109,7 +110,7 @@ heatmapClasses <- function(pl,
geom_segment(
data = dend$segments,
aes(x = y, y = x, xend = yend, yend = xend)) +
scale_x_reverse() +
scale_x_reverse(expand = c(0,0)) +
scale_y_continuous(breaks = seq_along(dend$labels$label),
labels = dend$labels$label,position = 'right',
expand = c(offset,offset)) +
Expand Down

0 comments on commit f26523a

Please sign in to comment.