How To Plot A 'Longer' Heatmap Using R?
3
1
Entering edit mode
10.6 years ago
jlshi.nudt ▴ 240

Hi, I try to plot a heatmap for 200*40 matrix. But the heatmap function output a figure without clear row label, and the outline of the figure likes square. I try to plot a longer figure perhaps to solve this problem, but I don't know how to do this work.
Anyone can tell me? Thank you.

r heatmap • 14k views
ADD COMMENT
1
Entering edit mode

Please post the code you're using to make your heatmap.

ADD REPLY
3
Entering edit mode
10.6 years ago

While I disagree that a longer plot will be any clearer; I can answer your technical question.

(in R) The size of the plot is scaled to the "output device" which you can specify by wrapping the plotting code in two new statements.

pdf("filename.pdf",width=24,height=8)
#heatmap()
dev.off()

That will make a 24" wide, 8" tall file that should look nice. Depending on your environment those might be specified as centimeters or inches. Another good one is

png("filename.png",width=2000,height=800)
#heatmap()
dev.off()

That will make a 2000x800 pixel bitmap image.

ADD COMMENT
0
Entering edit mode

That partly solves my problems, thank you.

ADD REPLY
2
1
Entering edit mode

(+1) Nice alternatives!

ADD REPLY
0
Entering edit mode
5.5 years ago
srgk26ster ▴ 20

I appreciate that this has been a long time since your question, and may not directly answer your question. But I just developed a Julia-based GUI tool to plot heatmaps based on Python's Seaborn package, just wanted to share it here. Very minimal/no coding is required for this. This is the link:

https://github.com/srgk26/easy_plotting.app

ADD COMMENT

Login before adding your answer.

Traffic: 1733 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6