简体   繁体   English

当我有相应的 x 和 y 坐标时,在图形上插入 2 个图像

[英]Insert 2 image on the figure when I have corresponding x and y coordinates

I need any guidance about how I can insert two.png images on the current figure (that is a map of the country) by having x and y coordinates of each png.我需要关于如何通过每个 png 的 x 和 y 坐标在当前图形(即国家的 map)上插入 two.png 图像的任何指导。 I did this in PowerPoint (see the figure below) but as I have more than 2000 points it would be awesome if it is possible to do it by Matlab.我在 PowerPoint 中完成了此操作(见下图),但由于我有超过 2000 分,如果可以在 Matlab 之前完成,那就太棒了。

Click to view点击查看

The current figure is the country map and my two png's are these two colorful circles.当前数字是国家 map,我的两个 png 是这两个彩色圆圈。

Thank you all谢谢你们

Here is an easy approach: Say im1 is your circles map and im2 is the Iran's map.这是一个简单的方法:假设im1是您的圈子 map, im2是伊朗的 map。

im1 = ones(64);
im1(20:40,20:40) = 0.5; 
im2 = rand(64);

figure
imshow(im1,[]);
hold on
h = imshow(im2,[]);
h.AlphaData = 0.3; % or whatever Transparency makes you happy

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

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