[R] How to plot a pretty heatmap with uneven distributed data?

Jim Lemon jim at bitwrit.com.au
Sun Sep 1 00:04:16 CEST 2013


On 08/31/2013 07:29 PM, Wei Liu wrote:
> Dear All,
>
> I want to plot a heatmap with R, but my data  distributed unevenly, for
> example, my data range from 10 to 1500, but most of the data smaller than
> 200, when I plot a heatmap, the colour is also distributed unevenly, most
> part of the heatmap is one colour, so the heatmap is ugly and meaningless.
>
> So can anybody help me plot a pretty heatmap for me with the attached data.
> I am looking forward your reply! Thansk very much.
>
Hi Wei Liu,
You would have to explain the transformation of your variables, but 
perhaps something like:

library(plotrix)
color2D.matplot(log(example_data+0.01),extremes=c("red","blue"))

would do what you want.

Jim



More information about the R-help mailing list