Placing Custom Images in a Plot Window--as custom data markers or to annotate those markers

前端 未结 5 1412
谎友^
谎友^ 2020-12-01 00:19

I have a set of 150x150px png images, and a set of (x, y) coordinates that they correspond to. Is there a way to plot the images on a grid? For example, I\'m looking for an

5条回答
  •  情深已故
    2020-12-01 00:59

    In R, readed in the help(rasterImage):

    require(grDevices)
    #set up the plot region:
    op <- par(bg = "thistle") 
    plot(c(100, 250), c(300, 450), type = "n", xlab="", ylab="")
    image <- as.raster(matrix(0:1, ncol=5, nrow=3))
    rasterImage(image, 100, 300, 150, 350, interpolate=FALSE)
    rasterImage(image, 100, 400, 150, 450)
    rasterImage(image, 200, 300, 200 + xinch(.5), 300 + yinch(.3), interpolate=FALSE)
    rasterImage(image, 200, 400, 250, 450, angle=15, interpolate=FALSE)
    par(op)
    

    ....is a nice example.

提交回复
热议问题