An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20131121/46579cb3/attachment.pl>
xyz-contour plot (irregular grid)
3 messages · ivo welch, David L Carlson, David Winsemius
I'm not sure if there is a single function, but a quick script would look something like this and would be easily adjusted attach(mtcars) mtcars.ls <- loess(mpg~wt*hp) wtg <- seq(min(wt), max(wt), length.out=50) hpg <- seq(min(hp), max(hp), length.out=50) grid <- expand.grid(wt=wtg, hp=hpg) mpg.fit <- predict(mtcars.ls, grid) contour(wtg, hpg, mpg.fit, xlab="Weight (1,000 lbs)", ylab="Horsepower") points(wt, hp, pch=20) ------------------------------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of ivo welch Sent: Thursday, November 21, 2013 10:35 PM To: r-help Subject: [R] xyz-contour plot (irregular grid) Dear R users: before I try to undertake my own rewrite, has anyone already written a contour function that does not require a regularly spaced grid, preferably plot.contour(x,y,z,...)? (it would be nice if it were based on loess() and plot()? further annotations, changes, etc., would then be easier.) sincerely, /iaw ---- Ivo Welch (ivo.welch at gmail.com) ______________________________________________ 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.
On Nov 21, 2013, at 8:35 PM, ivo welch wrote:
Dear R users: before I try to undertake my own rewrite, has anyone already written a contour function that does not require a regularly spaced grid, preferably plot.contour(x,y,z,...)? (it would be nice if it were based on loess() and plot()? further annotations, changes, etc., would then be easier.)
The akima function in the package by the same name provides that facility.
David Winsemius Alameda, CA, USA