nik
nik

Reputation: 2584

how to change the color key height in heatmap.2

I am trying to reduce the size of the heatmap.2 color key

it is now like this

enter image description here

key=T,  # add the key color
key.title =NA,
cexRow = 0.75, 
cexCol=0.75,

I want to reduce the higth of it and become like this

enter image description here

This is how I plot my heatmap

heatmap.2(mat_data,
          key=T,  # add the key color
          key.xlab="label",
          key.title =NA,
          cexRow = 0.75, 
          cexCol=0.75,
          #lhei = c(5,5),
          #cellnote = mat_data,  # will display the values 
          main = "title to be shonwn ", # heat map title
          #notecol=NA,          # change font color of cell labels to black
          density.info="none",  # turns off density plot inside color legend
          trace="none",         # turns off trace lines inside the heat map
          margins =c(15,20),     # widens margins around plot
          col=myPalette,       # use on color palette defined earlier
          breaks=col_breaks,    # enable color transition at specified limits
          dendrogram="row",     # only draw a row dendrogram
          Colv="NA",
          notecex=1.0)  

I found that

keysize=1

can change the size by you don't have any power to adjust the size as you want

Upvotes: 3

Views: 6846

Answers (1)

Nightwriter
Nightwriter

Reputation: 524

This can be set with the lhei parameter in heatmap.2()

heatmap.2(data,lhei = c(1,7))

The parameter is a vector of length two, and appears to be the relative height of the key and the heatmap.

Upvotes: 7

Related Questions