help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image aspect ratio


From: Ben Abbott
Subject: Re: Image aspect ratio
Date: Sat, 13 Aug 2011 10:53:09 -0400

On Aug 13, 2011, at 9:00 AM, Divakar Ramachandran wrote:

> I am using Octave 3.2.4 on Microsoft Windows 7.
> 
> A = imread("A8.tif");
> 
> followed by
> 
> imshow(A) or imagesc(A)
> 
> results in a Gnuplot window that displays the image stretched along x-axis. 
> axis("square") or axis("image") improves the aspect ratio slightly, but not 
> to 1:1 that I require.
> 
> Is there any workaround for this?
> 
> Thanks in advance,
> Divakar

My initial thought is that your image isn't square. What is its size ?

        size (A)

Another possibility is that your display has a different number of pixels per 
inch in the horizontal and vertical directions? (this is rather rare).

If you type the commands below ...

        imshow (A)
        axis on

... and then measure the physical size of the axes box, what does the following 
return?

        dpi = [diff(get(gca,"xlim")), diff(get(gca,"ylim"))] ./ 
[axis_box_width, axis_box_height]

... where axis_box_width and axis_box_height are the physical sizes of the plot.

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]