bugGNU Octave - Bugs: bug #48350, plot error calculating yticks on...

 
 

bug #48350: plot error calculating yticks on large constant plus small delta

Submitted by:  None
Submitted on:  Thu 30 Jun 2016 09:04:49 AM UTC  
 
Category: PlottingSeverity: 4 - Important
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Robert JenssenOriginator Email: -unavailable-
Open/Closed: ClosedRelease: dev
Operating System: GNU/Linux

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 Jump to the original submission)

Wed 24 Aug 2016 01:46:25 PM UTC, comment #7:

The other calculations all used type double to represent values so I changed i1 and i2 to double as well to work around this regression. See this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/59d66abc27d0).

Fixed, closing report.

Rik <rik5>
Project Administrator
Sat 23 Jul 2016 06:46:14 AM UTC, comment #6:

This works for me:

Robert Jenssen <morgawr>
Fri 01 Jul 2016 05:26:35 PM UTC, comment #5:

Note that

(as opposed to 5e-10) doesn't select a very good range for y axis.

Dan Sebald <sebald>
Fri 01 Jul 2016 04:55:13 PM UTC, comment #4:

Wait, actually the long long type did work. I forgot to change the explicit cast from <int> to <long long>. Here's what I see:

So the attached patch works. Again, it seems like there should be a better approach that subtracts out the mean or "median integerized value", if you follow what I'm saying. I.e., so that i1 and i2 become 0 and 7. Part of the reason I say this is that the y-axis labels become meaningless--they all say "15". In gnuplot, something like:

has y axis labels:

15.00000004
15.00000003
15.00000003
15.00000002
15.00000002
15.00000001
15.00000001
15.00000000

That's a little improvement, but still it seems one should be able to write this as 15+##e-8 if you follow.

Anyway, the attached patch works, and I'm inclined to be content with it because of how time-consuming it is to compile the project when the graphics.cc file is touched.

PS: I can guess why the out-of-memory error message of the original bug. In the code is

Matrix tmp_ticks (1, i2-i1+1);

when the i2 and i1 are bogus, it is probably trying to create some huge matrix.

(file #37655)

Dan Sebald <sebald>
Fri 01 Jul 2016 08:49:23 AM UTC, comment #3:

I followed this one through the code. This is the failing line:

(I put some debug lines in _line_.m and got a plot but there is no y-axis tics or labels.) _go_line_ is internal, in the file graphics.cc as follows:

And GO_BODY is

which takes us to

My best guess is that internally something is going wrong with the line construction or plotting and the return value of _go_line_ is invalid such that Octave thinks it is trying to index something (what should be a returned handle) it doesn't know about. E.g., there is no "ans = -2.1370" or something like it even though my plot is occurring.

The construction of the line and its properties seems pretty straightforward. There is a go.initialize() though, and this function gets called (I placed the fprintf() calls within):

Here is what I'm seeing (snipping out the garbage):

That seems OK, nothing is being lost in the data (e.g., there is no double conversion to float or int or anything).
-verbatim-

Maybe it is this routine:

YES, I think that is where the problem lies. I can say that this is not correct:

The result I see is:

Because the tick_sep turns out to be so small, the division is putting that double value outside the range of an int and the value is wrapping to negative numbers.

I changed the type of i1 and i2 to "long long", but that didn't fix the problem. I suppose it is the double arithmetic that is saturating. But I'm not sure that is the way to fix this anyway. Probably the right thing to do is to subtract the mean value from the data somehow before doing the range integerization. (Takes quite a while to compile though, so I've had enough for now.)

Dan Sebald <sebald>
Thu 30 Jun 2016 04:59:44 PM UTC, comment #2:

Confirmed, the following works in Octave 4.0.2 but not on the default branch

Mike Miller <mtmiller>
Project Administrator
Thu 30 Jun 2016 10:57:23 AM UTC, comment #1:

The problem seems to be in function axes::properties::calc_ticks_and_lims()
at graphics.cc:6857:

The debugger shows:

Doing "plot(T-15)" gives sensible results.

Robert Jenssen <morgawr>
Thu 30 Jun 2016 09:04:49 AM UTC, original submission:

I built a debug version of the development sources (see the attached output from _octave_config_info_) and ran the test_plot.m script that is also attached. Results:

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #37631:  octave_config_info.txt added by None (28KiB - text/plain - Script causes plot failure with fltk and gnuplot toolkits)
file #37632:  test_plot.m added by None (2KiB - text/x-objcsrc - Script causes plot failure with fltk and gnuplot toolkits)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by sebald (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by morgawr (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 24 Aug 2016 01:46:25 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Fri 01 Jul 2016 04:55:13 PM UTCsebaldAttached File-=>Added octave-longlong_tick_vars-bug48350-djs2016jul01.patch, #37655
    Thu 30 Jun 2016 05:05:42 PM UTCmtmillerSummaryplot fails =>plot error calculating yticks on large constant plus small delta
    Thu 30 Jun 2016 04:59:44 PM UTCmtmillerStatusNone=>Confirmed
      Summaryplot fails on development build=>plot fails
    Thu 30 Jun 2016 04:59:43 PM UTCmtmillerSeverity3 - Normal=>4 - Important
    Thu 30 Jun 2016 09:04:50 AM UTCNoneAttached File-=>Added octave_config_info.txt, #37631
      Attached File-=>Added test_plot.m, #37632

    Back to the top


    Powered by Savane 3.1-cleanup1