[R-sig-Geo] Newbie Question...

Michael Sumner mdsumner at gmail.com
Tue Jan 5 03:45:03 CET 2010


Here's one way. I'm not sure about how to control the aspect ratio
(something I've been meaning to check for a while now).

library(sp)
data(volcano)
x <- 10*(1:nrow(volcano))
y <- 10*(1:ncol(volcano))

## image xyz list
imlist <- list(x = x, y = y, z = volcano)

## SpatialGridDataFrame (image2Grid is v. simple, see definition)
imspdf <- image2Grid(imlist)

image(imspdf, col = terrain.colors(100),axes = FALSE, asp = "")
contour(imspdf, levels = seq(90, 200, by=5),add = TRUE, col ="peru")
axis(1, at = seq(100, 800, by = 100))
axis(2, at = seq(100, 600, by = 100))
box()
title(main = "Maunga Whau Volcano",font.main = 4)



On Tue, Jan 5, 2010 at 1:34 PM, Jason Rupert <jasonkrupert at yahoo.com> wrote:
> At the suggestion of Walmes Zeviani I downloaded and am taking a look at the sp package.
>
> In an attempt to get going, can someone offer a suggestion about how to convert the below over to a version that uses the sp package?
>
> data(volcano)
> x <- 10*(1:nrow(volcano))
> y <- 10*(1:ncol(volcano))
>
> image(x, y, volcano,col = terrain.colors(100),axes = FALSE)
> contour(x, y, volcano, levels = seq(90, 200, by=5),add = TRUE, col ="peru")
> axis(1, at = seq(100, 800, by = 100))
> axis(2, at = seq(100, 600, by = 100))
> box()
> title(main = "Maunga Whau Volcano",font.main = 4)
>
> Thanks for any feedback and insights.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list