bugGNU Octave - Bugs: bug #33748, plotyy: only subset of data...

 
 

bug #33748: plotyy: only subset of data series plotted in FLTK

Submitted by:  Philip Nienhuis <philipnienhuis>
Submitted on:  Mon 11 Jul 2011 01:09:13 PM UTC  
 
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 2Item Group: Incorrect Result
Status: DuplicateAssigned to: None
Originator Name: Philip NienhuisOpen/Closed: Open
Release: 3.4.2Operating System: Any

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
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):
   
   
Comment:
   

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    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
      StatusNone=>Duplicate
    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-cleanup