Re: [R] Annotate a levelplot (using abline) - Difficulty with trellis.

From: Dan Bolser <dan.bolser.r_at_googlemail.com>
Date: Wed 04 Apr 2007 - 14:52:30 GMT

My question was thus;

Given

  library(lattice)
  my.m <- matrix(seq(1,100,1),nrow=10)
  levelplot(my.m)

How can I add a diagonal line onto the resulting 'color square'?

The answer I found was to hack the 'panel.levelplot' function. Here is the diff between the old (panel.levplot) and the new (my.panel.levplot) functions;


And then use...

  library(lattice)
  my.m <- matrix(seq(1,100,1),nrow=10)
  levelplot(my.m, panel=my.panel.levelplot)

I accidentally started to talk to Charilaos Skiadas 'off-list', so thanks to him for help.

Dan.

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch 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. Received on Thu Apr 05 00:59:57 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 04 Apr 2007 - 15:30:53 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.