bugGNU Octave - Bugs: bug #58540, plotting does not handle very...

 
 

bug #58540: plotting does not handle very small positive data properly (of order realmin ("single"))

Submitter:  Daniel Molina García <dmolina>
Submitted:  Wed 10 Jun 2020 11:14:40 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  3 - Low Item Group:  Unexpected Error or Warning
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 10 Jun 2020 11:42:17 PM UTC, comment #1: 

Confirmed.  It's not just logscale.  Any very small values are likely to be a problem.  Here is an example with plot().


x = 1:20;
y = eps(0)*x;
plot (x,y)
error: set: "dataaspectratio" must be finite
error: called from
    __plt__>__plt2vv__ at line 500 column 10
    __plt__>__plt2__ at line 247 column 14
    __plt__ at line 112 column 18
    plot at line 228 column 10


But, I think this may be an infrequent problem.  The magnitude of the numbers you are working with are very, very small.


eps (0)
ans = 4.9407e-324
eps (1)
ans = 2.2204e-16


This is yet another example of the problems that OpenGL has because it uses single precision rather than double precision.  This plot works


x = 1:20;
y = 1e-37 * x;
plot (x,y)


But this one already starts to show degradation


x = 1:20;
y = 1e-38 * x;
plot (x,y)


And it is no coincidence that


realmin ('single')
ans = 1.1755e-38


I'm marking as confirmed, but lowering the priority.  Octave probably needs to switch to using double precision for plotting, but this is a big overhaul and has been a requested feature for many years.

Rik <rik5>
Group administrator
Wed 10 Jun 2020 11:14:40 PM UTC, original submission:  

Hello, I found some similar bugs related with negative or zeros marked as fixed: #36493 and #51861. I did not a find a report with very small positive values.

As it can be seen, normal plots do not work after the error happens

Example to reproduce it:


octave:1> x = 1:20;
octave:2> y = eps(0)*ones(1, 20);
octave:3> plot (x,y) # It works
octave:4> semilogy (x,y)
error: out of memory or dimension too large for Octave's index type
error: called from
    __plt__>__plt2vv__ at line 500 column 10
    __plt__>__plt2__ at line 247 column 14
    __plt__ at line 112 column 18
    semilogy at line 65 column 10
octave:5> plot (x,y)
error: set: "dataaspectratio" must be finite
error: called from
    delete at line 65 column 5
    newplot at line 209 column 11
    plot at line 227 column 9
octave:6> warning: opengl_renderer: data values greater than float capacity.  (1) Scale data, or (2) Use gnuplot

octave:6> plot (1:10,1:10)
error: set: "dataaspectratio" must be finite
error: called from
    delete at line 65 column 5
    newplot at line 209 column 11
    plot at line 227 column 9
warning: opengl_renderer: data values greater than float capacity.  (1) Scale data, or (2) Use gnuplot


Daniel Molina García <dmolina>

 

(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 rik5 (Posted a comment)
  • -email is unavailable- added by dmolina (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-10 rik5 Summarylogscale does not handle very small positive data properly plotting does not handle very small positive data properly (of order realmin ("single"))
    2020-06-10 rik5 Priority5 - Normal 3 - Low
        Item GroupNone Unexpected Error or Warning
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code