Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change title fontsize in heatmap.2 function?

I am using the heatmap.2 package to make a heatmap:

heatmap.2(as.matrix(FOOBAR.txt[rowSums (abs(FOOBAR.txt)) != 0,]),
          col=scaleyellowred,
          margins = c(10, 20),
          trace="none",
          xlab = "Comparisons",
          ylab ="gene",
          lhei = c(2, 8),
          scale=c("none"),
          symbreaks=T,
          cexRow=0.5,
          cexCol=.7,
          main="gene comparisons")

The output gives me a heatmap look like I want and looks good with the exception that the main title font is large. How do I decrease the font size of the title? I can't seem to figure it out. I can alter the font of the axis labels but not the title.

like image 340
user1352084 Avatar asked Dec 09 '13 16:12

user1352084


People also ask

How do you change the font on Seaborn heatmap?

Create a dataframe using Pandas data frame. Create a heatmap using heatmap() method. To adjust the font size in Seaborn heatmap, change the fontsize value. To display the figure, use show() method.

How do I increase font size in heatmap?

We can change the fontsize , fontweight , and fontfamily . The fontsize property will increase our heatmap font size. We can resize those rectangles using a square argument. We can specify if we would like each of those rectangles to be a perfect square; we can turn this on by setting it equal to True.


1 Answers

heatmap.2 use this statement to print plot title:

title(main, cex.main = 1.5 * op[["cex.main"]])

So You should set cex.main argument in par list. For example:

par(cex.main=0.5) ## this will affect also legend title font size
like image 105
agstudy Avatar answered Sep 20 '22 00:09

agstudy