bugGNU Octave - Bugs: bug #33249, log plots with all negative data...

 
 

bug #33249: log plots with all negative data don't plot (FLTK)

Submitter:  Carlo de Falco <cdf>
Submitted:  Fri 06 May 2011 06:15:05 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 02 Feb 2012 06:25:20 PM UTC, comment #10: 

The FLTK backend has been fixed to handle all negative data for some time now.  Closing bug.

Rik <rik5>
Group administrator
Fri 30 Sep 2011 08:21:52 PM UTC, comment #9: 

Re-titling bug to reflect the actual remaining problem.  The problem does not occur with gnuplot.

Sample code to provoke bug


a = logspace (-5,1,10);
b = -a;
loglog (a,b);


Rik <rik5>
Group administrator
Wed 07 Sep 2011 12:09:00 AM UTC, comment #8: 

But should it be?

Seems useful to me.

Michael Godfrey <godfrey>
Group Member
Tue 06 Sep 2011 11:28:41 PM UTC, comment #7: 

The warning was already commented out.

John W. Eaton <jwe>
Group administrator
Tue 06 Sep 2011 10:52:44 PM UTC, comment #6: 

John,

Did you mean to comment out the warning?
It might be helpful to tell the user why no
data appeared.

Michael

Michael Godfrey <godfrey>
Group Member
Tue 06 Sep 2011 10:10:54 PM UTC, comment #5: 

I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/d44d7f3c7998

It avoids the crash for me.  It does not fix logarithmic plotting of all negative data.  That will be more work.

If others confirm that this patch fixes the crash, then maybe this report should be closed?  You could open another about the failure to correctly plot the data.

John W. Eaton <jwe>
Group administrator
Wed 31 Aug 2011 08:59:20 AM UTC, comment #4: 

One more remark:
The crash does not happen when all the data is negative.
When the argument is a data matrix, the crash happens
only when the first column is all negative
as seen with this script.


## semilogy and loglog deal gracefully with partially negative inputs
## UNLESS the FIRST column of the data matrix is entirely negative
n = 5;  # say
showbug = false ;
if showbug ## causes a bus error on semilogy(Z) ;
  Z = [ -1*rand(n,1) randn(n,8) ] ;  ## 9 colmuns, the first one is entirely negative (almost surely)
else
  Z = [ randn(n,3) -1*rand(n,1) randn(n,5) ] ;  ## The entirely negative column is not the first one.
endif
semilogy(Z) ;

JF Cardoso <jfcardoso>
Sun 08 May 2011 10:14:37 AM UTC, comment #3: 

Just one more comment: Matlab does NOT throw an error for data that are all negative, for example the following


>> a = logspace (-5, 1, 10);
>> b =-logspace (-5, 1, 10);
>> >> a = logspace (-5, 1, 10);
>> b =-logspace (-5, 1, 10);
>> loglog (a, b)
>>
>>


produces the plot attached, which is equivalent to


>> loglog (a, b)


but with the y axis inverted



Carlo de Falco <cdf>
Group Member
Sun 08 May 2011 04:14:18 AM UTC, comment #2: 

Confirmed on a recent tip (2011/05/07).  Interestingly, the problem is only when all of the data is negative.  If there is some positive data, then a warning message is printed (warning: axis: omitting nonpositive data in log plot).  The fix lies in graphics.cc around the axis limit code.

This is a regression as the following code worked, i.e., didn't produce a segfault in 3.2.4.


semilogy (1, -1)


Rik <rik5>
Group administrator
Fri 06 May 2011 07:18:33 PM UTC, comment #1: 

well,
actually in the example I sent the negative data were on the y-axis
but the same happens if it is on the x-axis


>> a = logspace (-5, 0, 10);
>> b = -logspace (-5, 0, 10);
>> loglog (b, a)
panic: Bus error -- stopping myself...
Bus error


the crash occurs with both gnuplot and fltk
c.

Carlo de Falco <cdf>
Group Member
Fri 06 May 2011 06:15:05 PM UTC, original submission:  


The following consistently crashes Octave


>> a = logspace (-5, 0, 10);
>> b = -logspace (-5, 0, 10);
>> loglog (a, b)
panic: Bus error -- stopping myself...
Bus error


Carlo de Falco <cdf>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jfcardoso (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by cdf (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-02-02 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2011-09-30 rik5 CategoryPlotting Plotting with OpenGL
        Item GroupSegfault, Bus Error, etc. Incorrect Result
        Summarylog plots with all negative data produce segfault log plots with all negative data don't plot (FLTK)
    2011-05-08 cdf Attached File- Added Screen shot 2011-05-08 at 11.45.45.png, #23369
    2011-05-08 rik5 StatusNone Confirmed
        Summarycrash in loglog with negative x-data log plots with all negative data produce segfault

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code