Find pixel coordinates of a line
5 views (last 30 days)
Show older comments
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?
0 Comments
Accepted Answer
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
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');
More Answers (0)
See Also
Categories
Find more on Annotations 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!