bugGNU Octave - Bugs: bug #33748, plot functions: only subset of...

 
 

bug #33748: plot functions: only subset of data series plotted with OpenGL

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Mon 11 Jul 2011 01:09:13 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  3 - Low Item Group:  Incorrect Result
Status:  Duplicate Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 30 Apr 2015 12:36:37 AM UTC, comment #7: 

This problem shows up now and then and tends to generate
duplicate bug reports. Untl it is fixed (by descaling the data)
it might be useful to put in a range test on the data and
issue a warning, at least, which explains the use of
single in OpenGL.

Michael Godfrey <godfrey>
Group Member
Sat 14 Mar 2015 01:06:07 PM UTC, comment #6: 

Updating bug description for the current development branch. Applies to both FLTK and Qt toolkits, and any plot function.

Mike Miller <mtmiller>
Group Member
Fri 26 Dec 2014 03:29:02 PM UTC, comment #5: 

Adding a dependency on bug #32980 which is the need for OpenGL to support doubles or for Octave to scale everything before presenting it to OpenGL.

Rik <rik5>
Group administrator
Mon 25 Jul 2011 03:59:45 PM UTC, comment #4: 

Yes, this issue needs to be fixed within the FLTK backend.  For the time being, the workaround is to do the scaling yourself.

Rik <rik5>
Group administrator
Mon 25 Jul 2011 12:25:08 PM UTC, comment #3: 

Sorry for a bit of delayed response.

Rik, I tried your script, thanks. Seems to work OK as far as plotting itself goes.
As the x-axes series are shifted in time, additional stuff is needed for properly labeling the X-axis ticks (e.g., datetick). But OK that can probably be done, with a bit of trickery.

Perhaps this trickery can even be turned into a provisional "front end" to the plotting functions as long as FLTK itself hasn't been fixed for this.
But the real solution IMO is what Michael has sketched, i.e. after inference of needed tickmarks, legends, scaling, ..., transforming the data series just before sending them to the actual plot engine. That is, if plot() etc work along this way.
I peeked inside plot and its private functions but where to begin is unclear to me (and probably beyond me anyway).

Philip Nienhuis <philipnienhuis>
Group Member
Wed 20 Jul 2011 09:23:00 PM UTC, comment #2: 

It is believed that this can be fixed by rescaling
the data before sending it to OpenGL.  It is OpenGL
that uses reals due to the fact that it makes use of
available hardware acceleration and few hardware systems
provide more that single precision.

It would be very helpful if someone with good knowledge
of OpenGL could work on this.

Michael Godfrey <godfrey>
Group Member
Wed 20 Jul 2011 08:30:31 PM UTC, comment #1: 

This is a problem with data precision and the fact that the FLTK uses variable of class single (~8 digits of precision) versus the doubles that gnuplot uses.

There is already a bug report filed against that so I am marking this as a duplicate.

It is simple to work around this issue.  In general, you want to discard any common element in the data to enhance the precision.  For example, imagine making a time series plot where the x-axis went from 2000 to 2009.  If I use that range I take 4 digits of precision.  Alternatively, I could subtract by the common factor 2000, and then the range is 0-9 which takes only 1 digit of precision.  I'm attaching a script which demonstrates how to get a correct plot using your data.  In this case I used center() on your x-axis data which subtracts the mean from data.


(file #23680)

Rik <rik5>
Group administrator
Mon 11 Jul 2011 01:09:13 PM UTC, original submission:  

When using fltk I only get a subset of my data plotted with the "plotyy" command (no matter which XY series) (see attached figA_fltk.png).
Using gnuplot I get the picture that I expect (see attached figB_gnuplot.png)

For some reason fltk consistently skips a number of data points before plotting the next in a series.
Adding series makes no difference; these are plotted at the same X locations.

FYI: error was hit on Octave-3.4.2 under MinGW but occurs identically on MandrivaLinux 2010.2 (with Octave-3.4.2).
I got more or less the same (erroneous) result in 3.2.4 (MinGW), save for some backward incompatibility issues with the attached script when adding a third series. So this issue exists for some time now.

Reproducable using the attached plotyy_fltk.m & plotyy_fltk.mat files:
put them together in a some directory;
in Octave, run plotyy_fltk.m

Philip Nienhuis <philipnienhuis>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #23680:  plotyy_fltk_fixed.m added by rik5 (206B - text/x-octave)
file #23640:  figA_fltk.png added by philipnienhuis (16KiB - image/png)
file #23641:  figB_gnuplot.png added by philipnienhuis (24KiB - image/png)
file #23642:  plotyy_fltk.m added by philipnienhuis (179B - text/x-objective-c)
file #23643:  plotyy_fltk.mat added by philipnienhuis (6KiB - application/octet-stream)

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by philipnienhuis (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 14 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-22 rik5 Open/ClosedOpen Closed
    2015-04-30 rik5 Dependencies- bugs #44963 is dependent
    2015-03-14 mtmiller Priority2 3 - Low
        Release3.4.2 dev
        Summaryplotyy: only subset of data series plotted in FLTK plot functions: only subset of data series plotted with OpenGL
    2014-12-26 rik5 Dependencies- Depends on bugs #32980
    2013-10-28 mtmiller CategoryNone Plotting with OpenGL
    2011-07-20 rik5 Attached File- Added plotyy_fltk_fixed.m, #23680
        Priority5 - Normal 2
        StatusNone Duplicate
    2011-07-11 philipnienhuis Attached File- Added figA_fltk.png, #23640
        Attached File- Added figB_gnuplot.png, #23641
        Attached File- Added plotyy_fltk.m, #23642
        Attached File- Added plotyy_fltk.mat, #23643

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code