Building an image in any place

I would like to add an image to the plot. I can successfully place an image in the range [0 1] using the image function, but I would like to be able to build it elsewhere. Here is an example:

require(rgdal)
require(RgoogleMaps)
bb <- qbbox(c(40.702147,40.711614,40.718217),c(-74.015794,-74.012318,-73.998284), TYPE = "all", margin = list(m=rep(5,4), TYPE = c("perc", "abs")[1]));

MyMap <- GetMap.bbox(bb$lonR, bb$latR,destfile = "MyTile3.png", maptype = "satellite")
plot(0:20,0:20)
image(MyMap$myTile,col=attr(MyMap$myTile,"COL"),add=TRUE)

This creates a tiny map located at the origin, and I would like it to cover the range of my choice (actually this is the actual latitude / longitude).

0
source share
2 answers

Use the arguments x and y for the image (). Note how the image (x) will work for the matrix or a list consisting of vectors $ x and $ y and the matrix $ z, but you can also explicitly pass the image (x = xvec, y = yvec, z = zmat).

, ( , [dim (z)] [dim (z) +1])

    dims <- dim(seqMyMap$myTile)
    image(x = seq(minX, maxX, length = dims[1]), y = seq(minY, maxY, length = dims[2]), z =  seqMyMap$myTile,col=attr(MyMap$myTile,"COL"),add=TRUE) 

? image - .

+1

subplot TeachingDemos ms.image my.symbols( TeachingDemos).

0

All Articles