[R] Making a very specific heatmap in R (ggplot2?)

Alexander Predeus predeus at gmail.com
Fri Oct 17 04:02:37 CEST 2014


Hello All,

I'm trying to figure out the (automated) way to generate heatmaps from
simple data tables with annotated rows and columns. In the end, I need
these files to be easily viewed in a browser.

The initial data tables are simple; numbers are row-normalized (values are
real numbers varying from -1.0 to +1.0), with rows numbered from a zero to
a certain integer, and columns are named with (sometimes lengthy) strings.

What I came up with so far is building the heatmap using standard facility
with a set resolution of the final png file:

Which sort of works sometimes:

And fails pretty miserably other times:

What I really would like to do, is to make a heatmap with set number of
pixels per square, with a set font size (in pixels as well), and then save
it as a .png with variable resolution (appropriate for each concrete
heatmap). That way, a cell would be always say 10 by 10 pixels, and the
text on the right is always 8 pixels tall.

Alternatively, of course, it would be very neat to save it in some vector
format easily interpreted by the browser, but I have an impression it is
not an easy feat to accomplish.

Thank you very much in advance.

	[[alternative HTML version deleted]]



More information about the R-help mailing list