bugGNU Octave - Bugs: bug #37420, plot(x,y) is broken for uint8

 
 

bug #37420: plot(x,y) is broken for uint8

Submitted by:  Hans-Jürgen Greif <grepi>
Submitted on:  Fri 21 Sep 2012 08:07:12 PM UTC  
 
Category: Plotting with gnuplotSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Ben Abbott <bpabbott>
Originator Name: H.-J.GreifOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 22 Sep 2012 06:31:50 PM UTC, comment #4:

Ok, I'm closing the ticket. It can be reopened in needed.

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Sat 22 Sep 2012 03:31:08 PM UTC, comment #3:

it works on subsequent changeset,
you can change the status to fixed

marco atzeri <matzeri>
Sat 22 Sep 2012 12:48:52 AM UTC, comment #2:

I found the problem/feature.

When combining a double() with a uint8(), the uint8() type has precedence. Thus, class ([uint8(1), double(1024)]) is converted to uint8, whose largest number is 255.

Ive pushed a changeset

http://hg.savannah.gnu.org/hgweb/octave/rev/283cada76dd6

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Fri 21 Sep 2012 08:56:38 PM UTC, 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).

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.

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

(file #26613)

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Fri 21 Sep 2012 08:07:12 PM UTC, original submission:

Hello,

in all octave versions > 3.6 I have found a severe plot bug:

A= imread('untersuche.tif'); % chess board

y=A(1, 1:537);

plot(1:537, y)

plot in octave end up at column 265.

plot-command in all Matlab versions > 2007b is ok.

Hans-Jürgen Greif <grepi>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #26613:  34720.gp added by bpabbott (11KiB - application/octet-stream - gnuplot plot stream)
file #26610:  octave_3_6_0_plot_result.png added by grepi (25KiB - image/png - untersuche.tif in png converted because size)
file #26611:  untersuche.png added by grepi (5KiB - image/png - untersuche.tif in png converted because size)
file #26612:  matlab_2007b_plot_result.png added by grepi (37KiB - image/png - untersuche.tif in png converted because size)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by matzeri (Posted a comment)
  • -unavailable- added by bpabbott (Updated the item)
  • -unavailable- added by grepi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 14 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 22 Sep 2012 06:31:50 PM UTCbpabbottStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sat 22 Sep 2012 12:48:52 AM UTCbpabbottItem GroupNone=>Incorrect Result
      StatusConfirmed=>Ready For Test
      Assigned toNone=>bpabbott
    Fri 21 Sep 2012 08:56:38 PM UTCbpabbottAttached File-=>Added 34720.gp, #26613
      CategoryPlotting=>Plotting with gnuplot
      StatusNone=>Confirmed
      Release3.6.2=>dev
      Operating SystemMac OS=>Any
      Summaryplot(x,y) =>plot(x,y) is broken for uint8
    Fri 21 Sep 2012 08:07:12 PM UTCgrepiAttached File-=>Added octave_3_6_0_plot_result.png, #26610
      Attached File-=>Added untersuche.png, #26611
      Attached File-=>Added matlab_2007b_plot_result.png, #26612

    Back to the top


    Powered by Savane 3.1-cleanup1