MATLAB: Can anyone please explain the syntax and purpose of plot() function

plot

I need to know if I can plot some (x,y) coordinate points on a .png file, for this purpose I need to know the proper syntax and usage of plot().

Best Answer

If you're trying to plot x,y data on an image, you can do this:
imshow('coins.png')
hold on
plot(1:300,linspace(1,20,300).^2)
where units plotted by plot are in pixels. Or your x,y data have some units other than pixels, you'll have to figure out the right arrays of xdata and ydata corresponding to pixels in the image. Then you can specify 'xdata',xarray,'ydata',yarray when you call imshow.