Plotting with image together with scatter plot
古いコメントを表示
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;
採用された回答
その他の回答 (1 件)
scatter(handles.axes1,5,6) just plots a single points at (5,6). Maybe that's the error. To scatter 100 points all over the image, use
I = rgb2gray(imread('peppers.png'));
imshow(I)
hold on
scatter(size(I,2)*rand(1,100), size(I,1)*rand(1,100), 'r.')
カテゴリ
ヘルプ センター および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!