在R中绘制图像顶部的点 [英] plotting points on top of image in R
问题描述
这些天我广泛使用R来分散情节。
大多数绘图都与图像处理有关,
最近我在考虑在图像上绘制散点图。
These days I am extensively using R to scatter plots. Most of the plotting is concerned with image processing, Recently I was thinking of plotting the scatter plots over an image.
例如,我想要这样的东西,
背景需要用我的图像填充。具有特定的规模。
而且我应该能够在这张图片的上方绘制积分(坐标)......
For example, I want something like this, The background needs to be filled with my image. With a particular scale. And I should be able to draw points (co-ordinates) on top of this image ...
这在R中是否可行?
如果没有,你们知道其他任何使这个变得容易的工具......
Is this possible in R? If not, do you guys know of any other tool that makes this easy ...
推荐答案
我是不是100%肯定你的想法,但我想首先你要加载并在R中绘制一个图像。你可以用 ReadImages
包来做到这一点:
I'm not 100% sure what you have in mind, but I think first you want to load and plot an image in R. You can do that with the ReadImages
package:
picture <- read.jpeg("avatar.jpg")
plot(picture)
然后你可以在它上面做一个散点图:
Then you can do a scatter plot on top of it:
points(runif(50,0, 128), runif(50,0,128))
这篇关于在R中绘制图像顶部的点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!