Plotting with image together with scatter plot
30 次查看(过去 30 天)
显示 更早的评论
I would like to plot an image together with scatter plot on a custom figure file that I had created but I am not sure why it dosent appear together, please advice, thanks
Below is the code that I had tried:
h=openfig('figure.fig'); handles = guihandles(h); i = imread('image.jpg'); scatter(handles.axes1,5,6)
hold on; imshow(i); hold off;
0 个评论
采纳的回答
matt dash
2014-12-8
You want to use the command "image", not "imshow". Imshow is meant to just display an image for quick viewing, it not meant to be part of a larger code that does anything with the image. You may also need to 1) draw the image first, so it's on the bottom (or give your scatter a z coordinate that is above the image, using scatter3) 2) use "axis image" to property scale the axes to the image.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!