From: Peleg Bahar on
HI,
I hava a BW picture that I want to display using imshow().
I want to add axis to the picture but i want to control the numbers on the axis.
e.g:
the picture is 900x360. when I display the picture the axes go from 0 to 900 and from 0 to 360.
I want to change it to 0 to 100 and 0 to 200 but still see the whole picture.

I have tried setting the axis manualy using axis([xmin xmax ymin ymax]), but it also shrinks my picture to these values.

What can I do to keep the picture at its original size and display other numbers on the axis?

Thank you!
Peleg
From: Pekka Kumpulainen on
"Peleg Bahar" <bahar_p(a)yahoo.com> wrote in message <hsdjhr$qa3$1(a)fred.mathworks.com>...
> HI,
> I hava a BW picture that I want to display using imshow().
> I want to add axis to the picture but i want to control the numbers on the axis.
> e.g:
> the picture is 900x360. when I display the picture the axes go from 0 to 900 and from 0 to 360.
> I want to change it to 0 to 100 and 0 to 200 but still see the whole picture.
>
> I have tried setting the axis manualy using axis([xmin xmax ymin ymax]), but it also shrinks my picture to these values.
>
> What can I do to keep the picture at its original size and display other numbers on the axis?
>
> Thank you!
> Peleg

You can set the tick positions and labels manually, something like this:
set(gca, 'XTick', [1 360], 'XTickLabel', {'0' '200'}, ...
'YTick', [1 900], 'YTickLabel', {'0' '100'})
hth
From: Peleg Bahar on
> You can set the tick positions and labels manually, something like this:
> set(gca, 'XTick', [1 360], 'XTickLabel', {'0' '200'}, ...
> 'YTick', [1 900], 'YTickLabel', {'0' '100'})
> hth

That's exectly what I was looking for!
Thank you very much!!
From: Steven Lord on

"Peleg Bahar" <bahar_p(a)yahoo.com> wrote in message
news:hsdjhr$qa3$1(a)fred.mathworks.com...
> HI,
> I hava a BW picture that I want to display using imshow().
> I want to add axis to the picture but i want to control the numbers on the
> axis.
> e.g:
> the picture is 900x360. when I display the picture the axes go from 0 to
> 900 and from 0 to 360. I want to change it to 0 to 100 and 0 to 200 but
> still see the whole picture.
>
> I have tried setting the axis manualy using axis([xmin xmax ymin ymax]),
> but it also shrinks my picture to these values.
>
> What can I do to keep the picture at its original size and display other
> numbers on the axis?

Use the XData and YData options for IMSHOW to specify the limits of the box
in which your image should be displayed.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ