octave-maintainers
[Top][All Lists]
Advanced

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

Re: more graphics changes.


From: Søren Hauberg
Subject: Re: more graphics changes.
Date: Mon, 19 Mar 2007 09:54:25 +0100
User-agent: Thunderbird 1.5.0.10 (X11/20070307)

Daniel J Sebald skrev:
Søren Hauberg wrote:
John W. Eaton skrev:

It would be helpful to me if people who have been using the new
graphics features could check that I haven't broken too many things.
Please report any problems that you find to this list.

I've actually used octave today for some real work so I hit a few bugs:

*) The axis when showing images isn't correct. This was fixed in previous version after some discussions on the behaviour. I think you just have to flip the y-axis. The problem can be illustrated by the following code:

  im = zeros(50, 50);
  im(30,  5:15) = 1;
  im(25:35, 10) = 1;
  imshow(im)
  hold on; plot(10, 30, 'r*'); hold off

This should show a black image with a white cross. In the center of the white cross a red * should appear.

Well, there may be an error there. I see some inconsistency using the image(x,y,im) form. Not sure what the convention is. Note however that the baby example of image comes out correct. Also, location (x,y) in the matrix representation of the image doesn't necessarily have to mean (x,y) in the plotting space. Many conventions have the image with reference point at the top left (and some have bottom left, unfortunately). If you can't supply a patch, let me know what the convention should be.
I'm not quite sure I understand what you write, but I'll answer anyway :-)

I've executed the following commands in Matlab:

>> im = ones(40,60);
>> image(im)
>> xlabel('X')
>> ylabel('Y')
>> hold on; plot(0, 0, 'r*'); hold off  % This plot doesn't show
>> hold on; plot(1, 1, 'r*'); hold off  & This plot shows

This generates the image you can see at http://hauberg.org/wiki/lib/exe/fetch.php?cache=cache&media=mlimplot.png

As you can see the vertical axis is the Y-axis and it corresponds to the row coordinates in the "im" matrix. And the horizontal axis corresponds to the column coordinates in the matrix.The origin of the coordinate system is at the top-left point in the image. I'm plotting a * in both (0,0) and (1,1) but only the one in (1,1) actually shows on the plot. So the axis start in (1,1)

Did that answer you question?
Søren


reply via email to

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