[R] how to plot 2d matrix as coloured squares?

Jim Lemon jim at bitwrit.com.au
Tue Apr 10 10:59:14 CEST 2012


On 04/08/2012 02:11 AM, Jonas Stein wrote:
> i have a matrix like
>
>      x1  x2  x3
> y1  2   34  5656
> y2  34  434 342
> y3  234 43  34
>
> i want to plot these values like here
> http://www.almob.org/content/2/1/12/figure/F5?highres=y
>
> The rainbow function could calculate a colour for each value.
> But how van i generate the square pattern?
>
Hi Jonas,
Try color2D.matplot (plotrix) or image (base graphics).

Jim



More information about the R-help mailing list