How can I plot a series of points onto an image?

32 views (last 30 days)
I have an image file called 'bottle.jpg' and x and y values in the form of x=[# # #] and y=[# # #].
I can not figure out how to plot the x and y values onto the image file in a figure so that the overlapped plot/image is the only thing shown.
Thanks.

Accepted Answer

Image Analyst
Image Analyst on 6 Apr 2015
yourImage = imread('bottle.jpg');
imshow(yourImage);
hold on;
plot(x, y, 'r*', 'LineWidth', 2, 'MarkerSize', 15);
title('Bottle wit coordinates on it', 'FontSize', 24);
  1 Comment
Haseeb Hassan
Haseeb Hassan on 2 May 2018
I want to plot 2-D plotting of grayscale image values.The below code
plot the 3-D values of a grayscale image.What i can use instead of
meshgrid function to plot 2-D values of a gray scale image.Please see
the pictures for more details.
Ix = imread('C:\Users\Haseeb\Desktop\images\capture.jpg');
I= rgb2gray(Ix);
x = 1:size(I,1);
y = 1:size(I,2);
[X,Y] = meshgrid(x,y);
figure,plot3(X,Y,I)

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!