Find pixel coordinates of a line

5 views (last 30 days)
I have used the find function to find the pixel coordinates of all the pixels in the three colored lines in the image. However, when I plot the pixel coordinates that I found, it looks like the lines have a different size.
The original image has a height of 2904 pixels and a width of 2890 pixels. So if you look at the plot, you can see that the position of the lines do not match up with those of the image. Why is this and how can I fix it?

Accepted Answer

Image Analyst
Image Analyst on 30 May 2013
I don't see the problem - they look the same shapes to me. What are the lines of code that were used to plot the lines over the image, and what were the lines of code used to plot the lines in the line plot? You do know that the line plot has the origin of the displayed axis at (500, 400) don't you? You can set xlim() and ylim() if you want the line plot to have the origin at (1,1) like the image.
  13 Comments
Tony D
Tony D on 3 Jun 2013
Edited: Tony D on 3 Jun 2013
I think that I figured it out, but I would need to remove the gray border on the figures so that the plot takes up the whole figure space. How can I do this?
Image Analyst
Image Analyst on 3 Jun 2013
Use set() to set the 'Position' property of the axes, something like (untested)
set(gca, 'Position', [.1, .2, .7, .5], 'Units', 'Normalized');

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!