octave-maintainers
[Top][All Lists]
Advanced

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

Re: more graphics changes.


From: Daniel J Sebald
Subject: Re: more graphics changes.
Date: Mon, 19 Mar 2007 13:22:10 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

Søren Hauberg wrote:

*) 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.

Give the attached patch a try. If "image" or its varieties has been called when axis hold is "off" then the ydir is reversed.

Dan
--- /usr/local/share/octave/2.9.9+/m/image/__img__.m    2007-03-15 
14:54:17.000000000 -0600
+++ ./__img__.m 2007-03-19 13:12:01.399394144 -0600
@@ -56,6 +56,10 @@
 
   set (ca, "view", [0, 90]);
 
+  if (strcmp (get (ca, "nextplot"), "replace"))
+    set (ca, "ydir", "reverse");
+  endif
+
   if (nargout > 0)
     h = tmp;
   endif
--- /usr/local/share/octave/2.9.9+/m/plot/__go_draw_axes__.m    2007-03-15 
14:54:20.000000000 -0600
+++ ./__go_draw_axes__.m        2007-03-19 12:59:04.494501640 -0600
@@ -335,7 +335,7 @@
 
            filespec{data_idx} = img_fname;
            titlespec{data_idx} = "";
-           usingclause{data_idx} = sprintf ("binary array=%dx%d scan=yx flipy 
origin=(%g,%g) dx=%g dy=%g using %s",
+           usingclause{data_idx} = sprintf ("binary array=%dx%d scan=yx 
origin=(%g,%g) dx=%g dy=%g using %s",
                x_dim, y_dim, x_origin, y_origin, dx, dy, format);
            withclause{data_idx} = sprintf ("with %s", imagetype);
 

reply via email to

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