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


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

Submitted by:  Philip Nienhuis <philipnienhuis>
Submitted on:  Mon 11 Jul 2011 01:09:13 PM UTC  
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 3 - LowItem Group: Incorrect Result
Status: DuplicateAssigned to: None
Originator Name: Philip NienhuisOpen/Closed: Closed
Release: devOperating 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 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>
Project 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>
Project Administrator
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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project Member


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

Attach File(s):

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)


   bug dependencies.

   bug dependencies.


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

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 22 Dec 2017 04:20:59 PM UTCrik5Open/ClosedOpen=>Closed
    Thu 30 Apr 2015 12:22:19 AM UTCrik5Dependencies-=>bugs #44963 is dependent
    Sat 14 Mar 2015 01:06:07 PM UTCmtmillerPriority2=>3 - Low
      Summaryplotyy: only subset of data series plotted in FLTK=>plot functions: only subset of data series plotted with OpenGL
    Fri 26 Dec 2014 03:29:02 PM UTCrik5Dependencies-=>Depends on bugs #32980
    Mon 28 Oct 2013 02:12:59 AM UTCmtmillerCategoryNone=>Plotting with OpenGL
    Wed 20 Jul 2011 08:30:31 PM UTCrik5Attached File-=>Added plotyy_fltk_fixed.m, #23680
      Priority5 - Normal=>2
    Mon 11 Jul 2011 01:09:13 PM UTCphilipnienhuisAttached 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.1-cleanup1