简体   繁体   English

在R中绘制图像顶部的点

[英]plotting points on top of image in R

These days I am extensively using R to scatter plots. 这些天我广泛使用R来分散图。 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 ... 而且我应该能够在这张图片的顶部绘制点(坐标)......

Is this possible in R? 这可能在R? If not, do you guys know of any other tool that makes this easy ... 如果没有,你们知道任何其他工具,使这很容易...

这种绘图的分步教程在R-wiki中

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: 我不是100%确定你的想法,但我认为首先你要加载并在R中绘制图像。你可以使用ReadImages包来做到这一点:

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))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM