4

I am plotting a heatmap using pheatmap (Documentation). I am plotting a matrix in a fairly straightforward way:

pheatmap(mat, annotation_col=df, labels_col=rld$Infection_Line, fontsize_row=5, fontsize_col=7) 

The bottom of my plot is getting cut off so that I can't see the column names at the bottom. It looks like this: enter image description here I have tried to increase the margins using par() and oma(), as well as cexRow=...

I need to make it so that I can see these long column names without reducing my plot size. I just want to stretch the margin at the bottom down. Does anyone know how to do this?

Thanks in advance.

aosmith
  • 34,856
  • 9
  • 84
  • 118
Adam Price
  • 810
  • 2
  • 11
  • 21
  • 1
    Yeah, actually I did google it before posting here and I did try these other solutions already. I posted here because those don't seem to have any effect. These other answers are for heatmap.2. This is for pheatmap, which is different. – Adam Price Jun 22 '17 at 13:34
  • 2
    For future users landed on this thread, refer to this post for your reference: ***[Increase Margin of Pheatmap](https://stackoverflow.com/questions/44701207/column-labels-cropped-when-using-pheatmap)*** – M-- Jun 22 '17 at 13:52
  • `heatmap` and `pheatmap` are not the same. One uses base graphics while other uses grid graphics. This is not a duplicate question as the solutions are different. I have added a solution on Masoud's [question](https://stackoverflow.com/questions/44701207/column-labels-cropped-when-using-pheatmap). – mindlessgreen Aug 09 '17 at 11:50
  • @rmf You are right. The duplicated answer they marked could not fix this problem. – Shixiang Wang Sep 02 '17 at 15:23
  • I am having the sam problem, any help ? – Amaranta_Remedios Feb 23 '20 at 20:20

0 Answers0