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

9 vues (au cours des 30 derniers jours)
fawad khan
fawad khan le 22 Jan 2015
Commenté : fawad khan le 23 Jan 2015
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().
  4 commentaires
dpb
dpb le 23 Jan 2015
How do you plot on a file is the question?
If you really mean on a displayed image, then as the other respondent answered, you've simply got to scale to the image coordinates what it is that you wish to plot and have at it...
fawad khan
fawad khan le 23 Jan 2015
Okay, thanks a lot.

Connectez-vous pour commenter.

Réponse acceptée

Chad Greene
Chad Greene le 22 Jan 2015
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.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by