mercoledì 2 febbraio 2011

Plotting images on a grid using R or Python

A thread depicting how to insert a png image in a plot, thanks to Stackoverflow: plotting-images-on-a-grid.
A very basic tip, still useful to someone.

6 commenti:

  1. 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.

    i've responded also in the stackoverflow

    RispondiElimina
  2. Grazie per la correzione...

    RispondiElimina
  3. You're welcome! Here you can find a summary for the markdown syntax.

    RispondiElimina
  4. Very nice.
    I really like it!!!!

    RispondiElimina