[R] Plotrix Trick

Peter Langfelder peter.langfelder at gmail.com
Wed Jun 23 21:27:53 CEST 2010


On Wed, Jun 23, 2010 at 10:01 AM, Lorenzo Isella
<lorenzo.isella at gmail.com> wrote:
> Dear All,
> I am using the plotrix library to plot some matrices.
> I have a problem: some of my data are outliers, hence using a linear
> color scale does not work very well (you would see too many cells having
> a similar, indistinguishable color). See the code snipped at the end of
> the email.
> Plotting the logarithm of the data gets the job done, but my problem is
> that I would like to write in every cell the value of the corresponding
> entry of the original matrix, not is logarithm.
> Does anyone know how to get this done? Or the other way around: leave
> the data as is, but use a color log scale.
> Many thanks


Hi Lorenzo,

I'm not sure about plotrix, but the WGCNA package contains a function
called labeledHeatmap which allows you to specify the color matrix and
the text matrix separately. I'm the author of the package and of the
function. The WGCNA package is not on CRAN yet, but you can download
it from

http://www.genetics.ucla.edu/labs/horvath/CoexpressionNetwork/Rpackages/WGCNA/

Look at the help file for labeledHeatmap for some examples.  The
arguments are a bit arcane because I wrote the first version with a
very particular use in mind and then kept it for compatibility, but
you will find your way around.

Peter



More information about the R-help mailing list