Condensing dendrogram on heatmap.2
I have this heatmap that I'm pretty happy with but the dendrogram extends pretty far left. I'd like to scale it down or bring it in closer to the heatmap. I know that heatmap.2 plots it on a grid so maybe I need to restructure the plotting area with the layout function but I don't quite know how to use it. Does anyone have insight, recommendations?
Here is my code:
> library(gplots)
> library(RColorBrewer)
> zfpkm<-read.csv("~/Desktop/myosin_tpms_revised_043019.csv")
> rnames<-zfpkm[,1]
> mat_data<-data.matrix(zfpkm[,2:ncol(zfpkm)])
> rownames(mat_data)<-rnames
> my_palette<-colorRampPalette(c("blue", "yellow"))(n=1000)
> heatmap.2(mat_data, Colv=NA, main="Myosin Heatmap", margins=c(12,9), trace="none", dendrogram="row", scale="row")
And here is the heatmap it generates. **I can't get the image to show up: https://ibb.co/10CpDqn
• 108 views
•
link
1 answer
In the meantime, I adjusted the margins.
> heatmap.2(mat_data, Colv=NA, main="Myosin Heatmap", col=my_palette, margins=c(8,5), trace="none", dendrogram="row", scale="row", cexRow=0.5,cexCol=0.8)
• 0 views
•
link
Log in to answer this question.