필터 지우기
필터 지우기

Image axis on four sides

조회 수: 3 (최근 30일)
amberly hadden
amberly hadden 2015년 9월 11일
답변: Image Analyst 2015년 9월 11일
Hi - I was wondering how could I show axis (x-axis and Y-axis) on both sides of an image.top and bottom left and right side.
Thanks

답변 (3개)

Walter Roberson
Walter Roberson 2015년 9월 11일
Perhaps you could adapt plotxxyy() ?

Hamoon
Hamoon 2015년 9월 11일
You can use this:
Im = imread('cameraman.tif');
imshow(Im);
image(Im);

Image Analyst
Image Analyst 2015년 9월 11일
Try this:
% Get sample image.
grayImage = imread('moon.tif');
imshow(grayImage);
[rows, columns, numberOfColorChannels] = size(grayImage)
% Put up tick marks all the way around
% and labels along the left and bottom edges.
axis on;
% Get existing y tick labels
yLabels = get(gca, 'YTickLabels')
% Add labels down the right side.
for k = 1 : length(yLabels)
y = str2double(yLabels{k});
label = sprintf('%3d', y);
text(columns+5, y, label);
end
% Get existing x tick labels
xLabels = get(gca, 'XTickLabels')
% Add labels along the top side.
for k = 1 : length(xLabels)
x = str2double(xLabels{k});
label = sprintf('%3d', x);
text(x - 15, -15, label);
end

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by