image - How to plot a picture in R and change its background color -
my goal plot r colored map of human body, , use here simplified example of smiley. see 2 options stuck both:
1) extracting different areas of body using photoshop, , plotting them on top of each other:
r link = "http://images.clipartpanda.com/clipart-smiley-face-9czenapce.jpeg" download.file(link,basename(link)) jj <- readjpeg("clipart-smiley-face-9czenapce.jpeg",native=true) plot(1, type="n", axes=f, xlab="", ylab="") rasterimage(jj,0.7,0.6,1,1)
i way like
rasterimage(jj,0.7,0.6,1,1, col="yellow")
but rasterimage works opaque pictures :/
2) defining polygon interactively clicking on picture, save polygon plot later on top of original pic. way create map of human body. maps countries , rely on available geographical data.
is there way "draw" in r lines , define polygons in easy way?
Comments
Post a Comment