here is a reprex
library(ggplot2)
library(reshape2)
dat <- iris[,1:4]
cor <- melt(cor(dat, use="p"))
head(cor)
heat <- ggplot(data=cor, aes(x=Var1, y=Var2, fill=value))
heat + geom_tile() + labs(x = "", y = "") + scale_fill_gradient2(limits=c(-1, 1))
how can I make the color bar height match and align with the y-axis?
many thanks!