bugGNU Octave - Bugs: bug #48889, rose() angular histogram incorrect...

 
 

bug #48889: rose() angular histogram incorrect for certain bin centers

Submitted by:  Rik <rik5>
Submitted on:  Wed 24 Aug 2016 08:29:59 PM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  Rik <rik5>
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

( Jump to the original submission)

Tue 27 Sep 2016 08:51:01 AM UTC, comment #7: 

This was far trickier than I expected.  There is a questionable choice in the algorithm used by Matlab for rose which means that the first and last bins may not be centered on the values specified by the user.  I added a Programming Note to the documentation, and also a warning() if the situation is encountered.  Matlab itself is now trying to deprecate rose in favor of polarhistogram which does not have this issue.

See cset http://hg.savannah.gnu.org/hgweb/octave/rev/e9f77d099a63.

Fixed, closing report.

Rik <rik5>
Project AdministratorIn charge of this item.
Wed 07 Sep 2016 03:52:01 PM UTC, comment #6: 

Re-opening the report and re-titling to reflect the remaining issue.

Rik <rik5>
Project AdministratorIn charge of this item.
Wed 07 Sep 2016 03:37:40 PM UTC, comment #5: 

The 180 degrees offset is fixed by the patch, but another problem with rose remains: specifying the bin centres does not produce correct results. I ran

rose([0,pi/2,pi,3*pi/2],[0,pi/2,pi,3*pi/2])

both on MATLAB and Octave. See the attached images roseMatlab.png and roseOctave.png for the result.


Martin Kunz <mkunz>
Mon 29 Aug 2016 07:19:23 PM UTC, comment #4: 

I pushed a fix to rose here (http://hg.savannah.gnu.org/hgweb/octave/rev/cc3be522ec79).  Closing report.

Rik <rik5>
Project AdministratorIn charge of this item.
Mon 29 Aug 2016 06:58:29 AM UTC, comment #3: 

Rik, here the results:

[th, r] =  rose ([1 2 2 4 4 4], [1 2])
th =
         0    1.5000    4.6416         0         0    4.6416    7.7832         0
r =
     0     5     5     0     0     1     1     0

Markus Mützel <mmuetzel>
Project Member
Sun 28 Aug 2016 05:55:13 PM UTC, comment #2: 

@Markus:

Could you run this additional example in Matlab?

[th, r] =  rose ([1 2 2 4 4 4], [1 2])

Rik <rik5>
Project AdministratorIn charge of this item.
Thu 25 Aug 2016 04:02:59 PM UTC, comment #1: 

Attached please find the diary file (R2015b).

(file #38352)

Markus Mützel <mmuetzel>
Project Member
Wed 24 Aug 2016 08:29:59 PM UTC, original submission:  

The rose angular histogram is producing values that are offset by 180 degrees from what they should be.

To verify, could someone test the following in matlab and upload the rose.log diary file?

diary rose.log
[th1, r1] = rose ([1 2 2 4 4 4], 8)
[th2, r2] = rose (2*[1 2 2 4 4 4], 8)
diary off

Rik <rik5>
Project AdministratorIn charge of this item.

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #38441:  roseMatlab.png added by mkunz (14KiB - image/png)
file #38442:  roseOctave.png added by mkunz (22KiB - image/png)
file #38352:  rose.log added by mmuetzel (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mkunz (Updated the item)
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    Follow 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-09-27 rik5 StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2016-09-07 rik5 StatusFixed => Confirmed
        Open/ClosedClosed => Open
        Summaryrose() angular histogram incorrect => rose() angular histogram incorrect for certain bin centers
    2016-09-07 mkunz Attached File- => Added roseMatlab.png, #38441
        Attached File- => Added roseOctave.png, #38442
    2016-08-29 rik5 StatusIn Progress => Fixed
        Open/ClosedOpen => Closed
    2016-08-28 rik5 StatusConfirmed => In Progress
        Assigned toNone => rik5
    2016-08-25 mmuetzel Attached File- => Added rose.log, #38352

    Back to the top


    Powered by Savane 3.5