[BioC] Fine tuning heatmap.2 graphics

Sean Davis sdavis2 at mail.nih.gov
Thu Mar 9 13:24:54 CET 2006




On 3/9/06 6:41 AM, "Marc Saric" <marc.saric at gmx.de> wrote:

> Dear all,
> 
> I like to use heatmap.2 from the gplots library package to automatically
> plot heatmaps from microarray data.
> 
> Things work fine so far, but two problems remain:
> 
> 1. Depending on the amount of data to be displayed, the fontsize of the
> labels changes dynamically (as it should) and with that, the
> margin-space required to print the labels changes also (leading to
> truncated labels sometimes).
> 
> This can be set manually with
> 
> margin <- c(x,y);
> 
> for both x and y axis labels margins.
> 
> Is there an easy way to compute the required margin size dynamically
> from -say- the lenght of the longest label-string?

Not sure here.  I imagine it is possible, but I don't know how to do it.

> 2. Plotting with heatmap.2 in the X11 device gives a plot, in which all
> the coloured rectangles are drawn without visible separating border
> between them.
> 
> When plotting as "pngalpha" with the bitmap device, you can see
> separating bright borderlines, which -due to the antialiasing- are only
> partly visible (i.e. some lines are there, some have been removed by the
> antialiasing).
> 
> Is there any option to remove this borders when plotting with bitmap and
> "pngalpha"?
> 
> I have tried with
> 
> sepwidth = c(0.0,0.0),
> sepcolor = "black",
> 
> but this does not have any visible effect.

If I remember, heatmap.2 doesn't actually put any separators between the
columns/rows by default.  (You can glance at the code to check.)  This
happens on some viewers with some formats, but the view that you see with
the X11 device is the one that heatmap.2 is actually drawing, I think, so
there isn't a way to eliminate this effect with those other devices.  Try
pdf or ps devices and see what you get.

Sean



More information about the Bioconductor mailing list