[R] Label Values in levelplot

Felix Andrews felix at nfrac.org
Mon Jun 28 01:32:46 CEST 2010


something like
panel = function(x, y, z, ...) {
    panel.levelplot(x, y, z, ...)
    panel.text(x, y, labels = z)
}

(if you have multiple panels you will need to use 'subscripts' too)


On 25 June 2010 13:16, Ben Wilkinson <bjlwilkinson at gmail.com> wrote:
> I am trying to add labels equal to the value in a levelplot. I believe that
> panel may be the way to go but cannot understand the examples.
>
> In the following example:
>
> X,Y,Z
> A,M,100
> A,M,200
> B,N,150
> B,N,225
>
> I would like to label each of the rectangles 100,200,150 and 225 and colour
> according to the value
>
> The colouring is achieved by
>
> levelplot(z ~ x *y , data) but then I get stuck with the labels
>
> Thanks
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Felix Andrews / 安福立
Integrated Catchment Assessment and Management (iCAM) Centre
Fenner School of Environment and Society [Bldg 48a]
The Australian National University
Canberra ACT 0200 Australia
M: +61 410 400 963
T: + 61 2 6125 4670
E: felix.andrews at anu.edu.au
CRICOS Provider No. 00120C
-- 
http://www.neurofractal.org/felix/



More information about the R-help mailing list