Adding X-Y axis into image file

126 views (last 30 days)
MSK
MSK on 12 Jul 2020
Commented: MSK on 13 Jul 2020
Hi,
can anyone help me to add horizontal and vertical axis on the below image (dimension is 380*584 pix = 50* 77 mm)

Accepted Answer

Image Analyst
Image Analyst on 12 Jul 2020
After you call imshow() call axis():
grayImage = imread('image.jpeg');
imshow(grayImage, [], 'XData', [0, 50], 'YData', [0, 77]);
axis('on', 'image');
  4 Comments
Image Analyst
Image Analyst on 13 Jul 2020
Edited: Image Analyst on 13 Jul 2020
You can use flipud() on the variable as you pass it into imshow():
grayImage = imread('image.jpeg');
imshow(flipud(grayImage), [], 'XData', [0, 50], 'YData', [0, 77]);
axis('on', 'image', 'xy');
Or reverse the numbers for YData:
grayImage = imread('image.jpeg');
imshow(grayImage, [], 'XData', [0, 50], 'YData', [77, 0]);
axis('on', 'image', 'xy');

Sign in to comment.

More Answers (0)

Categories

Find more on Image Processing Toolbox 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!