bugGNU Octave - Bugs: bug #64078, plotting functions with not-float...


bug #64078: plotting functions with not-float inputs result in errors or erroneous plots

Submitter:  Nicholas Jankowski <nrjank>
Submitted:  Thu 20 Apr 2023 04:02:15 PM UTC
Category:  Plotting Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  9.1.0 (current default)
* Mandatory Fields

Add a New Comment (Rich Markup)

( Jump to the original submission )

Wed 31 May 2023 05:24:51 AM UTC, comment #9: 

Yes, I’ve been slowly stepping through most functions in the scripts/plot/draw folder.  Will do some Matlab checks and report back soon

Nicholas Jankowski <nrjank>
Group Member
Wed 31 May 2023 12:19:51 AM UTC, comment #8: 

Is there a list of other plotting functions that need to be checked for their behavior with logical or integer inputs?

Rik <rik5>
Group administrator
Thu 11 May 2023 03:41:29 AM UTC, comment #7: 

as rik suggested in the other report, this can be checked/fixed in other plot functions as well. noticed a few this applies to, so retitling report and will catalog other plot functions for fixes

Nicholas Jankowski <nrjank>
Group Member
Thu 27 Apr 2023 12:15:59 AM UTC, comment #6: 

patch pushed as noted in bug #59695.  all inputs can be any numeric type or logical.  this also applies to scale factor which can also now be 'off'.


Nicholas Jankowski <nrjank>
Group Member
Wed 26 Apr 2023 05:53:49 PM UTC, comment #5: 

I think this behavior has changed.  I checked with Matlab (comment #1) five days ago and the stored data type now seems to be double.  That really simplifies things.

Rik <rik5>
Group administrator
Wed 26 Apr 2023 12:19:23 PM UTC, comment #4: 

Interesting. According to that report the data type is preserved. So the simple fix of recasting the inputs as double would fix the plot problem but wouldn’t be strictly compatible. Would instead have to change all of the operations using the data to double. (Or… cheat a bit and cast to double at the start and then recast the stored data to the input type at the end of the function)

Nicholas Jankowski <nrjank>
Group Member
Wed 26 Apr 2023 03:03:58 AM UTC, comment #3: 

This looks like it is the same issue as bug #59695.  Marking as a Duplicate, but keeping open since both can be resolved by casting the inputs to double.

Rik <rik5>
Group administrator
Fri 21 Apr 2023 11:11:58 PM UTC, comment #2: 

i was looking at adding some input validation.  I can add a double conversion at the front end as well which should take care of this.

Nicholas Jankowski <nrjank>
Group Member
Fri 21 Apr 2023 10:26:13 PM UTC, comment #1: 

I just checked with Matlab and U,V input of any kind (single, integer, logical) is converted to double.  I guess Octave should do the same thing.

Rik <rik5>
Group administrator
Thu 20 Apr 2023 04:02:15 PM UTC, original submission:  

noticed that while


produces a simple, horizontal single arrow quiver plot and

quiver(true, false)

produces an identical plot,

quiver(int32(1), int32(0))

does not. it produces an line going from 0,0 to 2,1, with no linesegment.

looking at the x and ydata, they stay as int32.  normally NaNs are used to separate data points, and int32 replaces them with 0s, and there arrowhead size calculations can't do fractions.

recommend the quiver/quiver3 functions internally convert data to double before handing of to `__quiver__`.

Nicholas Jankowski <nrjank>
Group Member


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

Attach Files:

No files currently attached


   bug dependencies.

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by nrjank (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 project members can vote.





    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-05-11 nrjank StatusReady For Test Confirmed
        Summaryquiver: int inputs result in erroneous plots plotting functions with not-float inputs result in errors or erroneous plots
    2023-04-27 nrjank StatusConfirmed Ready For Test
        Planned ReleaseNone 9.1.0 (current default)
    2023-04-26 rik5 Dependencies- Depends on bugs #59695
    2023-04-21 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.12