bugGNU Octave - Bugs: bug #41166, scatter with mix of int and double...

 
 

bug #41166: scatter with mix of int and double - casts double to integer class

Submitter:  CarnĂ« Draug <carandraug>
Submitted:  Thu 09 Jan 2014 07:07:08 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 14 Dec 2018 07:00:33 AM UTC, comment #3: 

This was easy to fix.  As jwe suggested, the problem in _scatter_ was that the vertices matrix was formed with


"vertices", [x(i), y(i), z(i,:)]


I changed the input validation to cast mixtures of floating point and integer data to floating point only.  See https://hg.savannah.gnu.org/hgweb/octave/rev/59bc720d1bf9.

Marking as fixed and closing report. 

Rik <rik5>
Group administrator
Fri 25 Nov 2016 11:06:47 PM UTC, comment #2: 

This issue is still present in Octave 4.2.0.

Hartmut <hardy>
Thu 09 Jan 2014 07:19:32 PM UTC, comment #1: 

I think the problem is that when _scatter_ is setting the values for the vertices, it is doing things like [x, y, z] and when operations like that involve a mixture of int and double values, the result is the int value.  That's not going to change (required for Matlab compatibility among other reasons) so we need to fix _scatter_ to avoid using this method of constructing the vertex values.

John W. Eaton <jwe>
Group administrator
Thu 09 Jan 2014 07:07:08 PM UTC, original submission:  

Given two datasets with different classes, scatter seems to be doing something funny with it:


graphics_toolkit fltk;
x = rand(10) * 3;
y = randi ([0 255], 10, "uint8");
figure; scatter (x(:), y(:));
figure; scatter (x(:), double(y(:)));


It would appear that it casts the x data (class double), to uint8 (the class of y) since all x values are plotted as integers.

Carnë Draug <carandraug>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by carandraug (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-14 rik5 Open/ClosedOpen Closed
    2018-12-14 rik5 StatusConfirmed Fixed
    2016-11-17 mtmiller CategoryPlotting with OpenGL Plotting
        Release3.8.0 dev
    2014-12-29 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code