Re: [R] lattice contourplot error

From: Deepayan Sarkar <>
Date: Mon, 21 May 2007 15:14:06 -0700

On 5/21/07, Mihai Bisca <> wrote:
> On 5/21/07, Deepayan Sarkar <> wrote:
> > > I get the following error message: Error in validDetails.text(x) :
> > > Invalid 'rot' value
> > This depends on the data (and I haven't been able to reproduce it),
> > but I'm pretty sure the culprit is the calculation of the rotation for
> > the contour labels. You can probably work around it by changing
> > '' (see ?panel.contourplot). I can try to fix it if you
> > give me a reproducible example (e.g. save() your matrix and send it to
> > me offline).
> Thank you for your interest. I'm new to R, but pretty enthusiastic
> about it. You can find attached the matrix in question. It's a
> representation of an optic disc from a retinal photograph.
> I noticed that the error occurs only when using the option 'pretty=T'.
> Also, it happens in two of about seven or eight similar objects I
> played with.

Cool example. It's a problem with the label rotation calculation (some are NaN, so presumably there's a division by zero somewhere). I'll try to track it down.

For your example, I don't think labels are going to be of any use, so I would suggest you try something like

contourplot(, cuts = 20, labels = FALSE)



both of which should be fine.

-Deepayan mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 21 May 2007 - 22:18:29 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 May 2007 - 23:31:14 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.