Image axis on four sides

27 views (last 30 days)
amberly hadden
amberly hadden on 11 Sep 2015
Answered: Image Analyst on 11 Sep 2015
Hi - I was wondering how could I show axis (x-axis and Y-axis) on both sides of an and bottom left and right side.

Answers (3)

Walter Roberson
Walter Roberson on 11 Sep 2015
Perhaps you could adapt plotxxyy() ?

Hamoon on 11 Sep 2015
You can use this:
Im = imread('cameraman.tif');

Image Analyst
Image Analyst on 11 Sep 2015
Try this:
% Get sample image.
grayImage = imread('moon.tif');
[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);
% 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);

Community Treasure Hunt

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

Start Hunting!