[R] Contour Plots

Martin Maechler maechler at stat.math.ethz.ch
Fri Jul 11 10:26:38 CEST 2003


>>>>> "Riley" == Riley Metzger <alpha_white_wolf at hotmail.com>
>>>>>     on Thu, 10 Jul 2003 13:53:56 -0400 writes:

    Riley> Hello, I'm a grad. student in statistics and am
    Riley> looking for some information on how R draws its
    Riley> contours.  I suspect you are using a Bezier spline.

I don't know if what we do can be called a Bezier spline (it
would be the most simple, i.e. "linear" one...), but in any
case, we simply do linear interpolation :

contour() uses data on a grid.
The only thing you have to do is drawing line segments in
rectangles. In the following case, given the z-values in points
A & B, find the "*" intersection on the AB line
A & C, find the "+" intersection on the AC line
now draw the segment from "*" to "+"

  A ____*____ B 
   |   .     |
   |  .      |
   | .       |
   |.        |
   +         |
   |_________| 
  C           D

(and all you guys with silly proportional fonts in your e-mail
 reader will not see a nice picture above ....)

Regards,

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><




More information about the R-help mailing list