bugGNU Octave - Bugs: bug #51861, loglog() does not handle negative...

 
 

bug #51861: loglog() does not handle negative data and zero properly

Submitted by:  Dmitri A. Sergatskov <dasergatskov>
Submitted on:  Sun 27 Aug 2017 02:15:33 AM UTC  
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
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 29 Aug 2017 05:54:14 PM UTC, comment #8: 

Dmitri, that error is caused by manually setting the axes limits to invalid limits with "axis" (a(1) is 0). The code path for auto limits and manual limits is different. Manually setting the limits still results in the error you see. This is indeed bug #43606.

The patch there no longer applies to a current tip. I will have a look whether I can refresh it.

Markus Mützel <mmuetzel>
Project Member
Tue 29 Aug 2017 03:09:43 PM UTC, comment #7: 

Unfortunately it still does not fix the original issue

https://lists.gnu.org/archive/html/help-octave/2017-08/msg00164.html

I still get misterious

error: set: "cameratarget" must be finite
error: called from
    __axis_limits__ at line 56 column 11
    xlim at line 53 column 7
    axis>__axis__ at line 333 column 9
    axis at line 158 column 7
    fft_noise_meas at line 62 column 37

but perhaps this is for another bug report.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 29 Aug 2017 02:55:33 PM UTC, comment #6: 

Markus:  I checked and 4.0.3 handled this correctly so I pushed your changeset to stable and merged with default.

http://hg.savannah.gnu.org/hgweb/octave/rev/20dd13700c08
http://hg.savannah.gnu.org/hgweb/octave/rev/882dd1c0017f

It seems to work for me, so I'm closing as fixed.

John W. Eaton <jwe>
Project Administrator
Sun 27 Aug 2017 11:30:42 AM UTC, comment #5: 

The patch in bug #43606 does NOT fix the problem here. (Although it fixes a similar issue with manually set limits.)

The attached patch fixes the calculation of automatic limits on logarithmic axes if the maximum value is at exactly 0.

(file #41678)

Markus Mützel <mmuetzel>
Project Member
Sun 27 Aug 2017 08:22:05 AM UTC, comment #4: 

This might be due to bug #43606. Plotting the 3 points intermittently sets the xlim to [-1 -0] (invalid for a log axis). This messes up the axes to a state from which it cannot recover. The following slightly reduced example also triggers the bug for me:

>> loglog ([-1 0], 1)
error: out of memory or dimension too large for Octave's index type
error: called from
    __line__ at line 120 column 16
    line at line 56 column 8
    __plt__>__plt2vs__ at line 468 column 15
    __plt__>__plt2__ at line 246 column 14
    __plt__ at line 113 column 17
    loglog at line 60 column 10
error: set: "cameratarget" must be finite
>> get (gca, "xlim")
ans =
  -1  -0

I will try whether the patch in that bug report also prevents the issue here.

Markus Mützel <mmuetzel>
Project Member
Sun 27 Aug 2017 07:49:05 AM UTC, comment #3: 

Perhaps. I see the same. Still a problem though.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sun 27 Aug 2017 05:48:15 AM UTC, comment #2: 

Actually, isn't this a problem with broadcasting or some such?  The code that causes the issue has 3 x-values but only 1 y-value.  If I modify it to have an equal number of x and y values then I get the expected error:

loglog (-1:1, [1 1 1])
warning: axis: omitting non-positive data in log plot
warning: called from
    __line__ at line 120 column 16
    line at line 56 column 8
    __plt__>__plt2vv__ at line 502 column 10
    __plt__>__plt2__ at line 248 column 14
    __plt__ at line 113 column 17
    loglog at line 60 column 10

Rik <rik5>
Project Administrator
Sun 27 Aug 2017 02:16:59 AM UTC, comment #1: 

I should have said "non-positive" rather than negative...

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sun 27 Aug 2017 02:15:33 AM UTC, original submission:  

With either 4.2.1 or recent hg:

octave:1> loglog((-1:1),1)
error: out of memory or dimension too large for Octave's index type
error: called from
    __line__ at line 120 column 16
    line at line 56 column 8
    __plt__>__plt2vs__ at line 468 column 15
    __plt__>__plt2__ at line 246 column 14
    __plt__ at line 113 column 17
    loglog at line 60 column 10
octave:1> loglog((-1:1),1)
error: set: "cameratarget" must be finite
error: called from
    delete at line 60 column 5
    newplot at line 202 column 11
    loglog at line 53 column 9

That actually messes up graphics subsystem for good, e.g. doing
simple plot(1:3) results in the same "error: set: "cameratarget" must be finite"

Note, one needs more than one illegal data to trigger this problem:

octave:1> loglog ([-1, 1, 2])
warning: axis: omitting non-positive data in log plot
warning: called from
    __line__ at line 120 column 16
    line at line 56 column 8
    __plt__>__plt2vv__ at line 502 column 10
    __plt__>__plt2__ at line 248 column 14
    __plt__>__plt1__ at line 207 column 10
    __plt__ at line 119 column 17
    loglog at line 60 column 10

looks fine.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #41678:  bug58161_logaxis_autolimit.patch 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 jwe (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by dasergatskov (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-29 jwe StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2017-08-27 mmuetzel StatusNeed Info => Patch Submitted
        Releaseother => dev
        Summaryloglog() does not handle multiple negative data properly => loglog() does not handle negative data and zero properly
    2017-08-27 mmuetzel Attached File- => Added bug58161_logaxis_autolimit.patch, #41678
    2017-08-27 rik5 StatusNone => Need Info

    Back to the top


    Powered by Savane 3.5