octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #37420] plot(x,y) is broken for uint8


From: Ben Abbott
Subject: [Octave-bug-tracker] [bug #37420] plot(x,y) is broken for uint8
Date: Fri, 21 Sep 2012 20:56:38 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25

Update of bug #37420 (project octave):

                Category:                Plotting => Plotting with gnuplot  
                  Status:                    None => Confirmed              
                 Release:                   3.6.2 => dev                    
        Operating System:                  Mac OS => Any                    
                 Summary:              plot(x,y)  => plot(x,y) is broken for
uint8

    _______________________________________________________

Follow-up Comment #1:

This bug is only present when using the gnuplot backend, and is present in the
developers sources.

Using the script below, I produced the attached plot stream to gnuplot
(34720.gp).


close all
graphics_toolkit gnuplot
A = imread ('untersuche.png');
y = A (1, :); 
plot (y) 
drawnow ("aqua", "/dev/null", false, "34720.gp")


I don't see anything wrong with the ascii content, and suspect the problem is
hidden in the binary part.  After experimenting, I found that converting "y"
to a double gives the desired result.  So, the following works for me.


close all
graphics_toolkit gnuplot
A = imread ('untersuche.png');
y = A (1, :); 
plot (double (y)) 


It doesn't fix the underlying bug, but a superficial fix (below) is to convert
the {x,y,z}data to doubles.


diff --git a/scripts/plot/private/__go_draw_axes__.m
b/scripts/plot/private/__go_draw_axes__.m
--- a/scripts/plot/private/__go_draw_axes__.m
+++ b/scripts/plot/private/__go_draw_axes__.m
@@ -441,6 +441,15 @@
     while (! isempty (kids))
 
       obj = get (kids(end));
+      if (isfield (obj, "xdata") && ! isempty (obj.xdata))
+        obj.xdata = double (obj.xdata);
+      end
+      if (isfield (obj, "ydata") && ! isempty (obj.ydata))
+        obj.ydata = double (obj.ydata);
+      end
+      if (isfield (obj, "zdata") && ! isempty (obj.zdata))
+        obj.zdata = double (obj.zdata);
+      end
 
       if (isfield (obj, "units"))
         units = obj.units;




(file #26613)
    _______________________________________________________

Additional Item Attachment:

File name: 34720.gp                       Size:11 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?37420>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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