bugGNU Octave - Bugs: bug #53832, Fractional independent variable...

 
 

bug #53832: Fractional independent variable mis-plotting in Qt, not Gnuplot.

Submitter:  AlanRobertClark <alanrobertclark>
Submitted:  Fri 04 May 2018 11:01:53 AM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Duplicate Assigned to:  None
Originator Name:  AlanRobertClark Open/Closed:  * Closed
Release:  * 4.2.2 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 10 May 2018 05:39:45 PM UTC, comment #2: 

Thanks Rik.

Since data was time-of-day within a (local) range of days, it took me a while to get round the scaling problem. For posterity, then, I revisited this report problem, the result of which is bg.m, operating on the original bg.dat.

Many many Thanks!
Alan.

(file #44135)

AlanRobertClark <alanrobertclark>
Fri 04 May 2018 08:28:53 PM UTC, comment #1: 

Alas, this is just another manifestation of the fact that OpenGL uses single precision variables for plotting while gnuplot, and Octave, use doubles.  See bug #32980 from 2011.

The solution is to scale the data before plotting.  In this case, the timestamp has a large constant value of 736177 and then a small changing value of order 1.  I just subtracted off the first timestamp value which then reveals that the range of data is [0, 2.17].  I have attached that as bg2.dat.

If you modify plotbug.m to load bg2.dat you will see that the plot is correct.

Marking as a duplicate and closing report.

(file #44096)

Rik <rik5>
Group administrator
Fri 04 May 2018 11:01:53 AM UTC, original submission:  

Independant data is a timestamp, dependant data is Blood Glucose.

I have attempted to include the files to demonstrate the offset diamond markers on the plot. Under certain circumstances, the error is quite large, and I have confirmed the error under 4.4 (flatpak version)

plotbug.m:

% Shows Qt vs gnuplot for fractional x data (datenum)
load bg.dat
figure('MenuBar','none');
plot(bg(:,1),bg(:,2),'-d');
grid on;

graphics_toolkit('gnuplot');
figure('MenuBar','none');
plot(bg(:,1),bg(:,2),'-d');
grid on;


The error was noted as I overplot ``points-of-interest'' using a plain marker over a line plot, and I noted that the marker was not at the vertex. Caused serious hair-loss.

AlanRobertClark <alanrobertclark>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #44135:  bg.m added by alanrobertclark (647B - text/x-objcsrc)
file #44096:  bg2.dat added by rik5 (526B - application/octet-stream)
file #44084:  plotbug.m added by alanrobertclark (222B - text/x-objcsrc)
file #44085:  qt.png added by alanrobertclark (16KiB - image/png)
file #44086:  bg.dat added by alanrobertclark (408B - application/octet-stream)
file #44087:  gnuplot.png added by alanrobertclark (15KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by alanrobertclark (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-05-10 alanrobertclark Attached File- Added bg.m, #44135
    2018-05-04 rik5 Attached File- Added bg2.dat, #44096
        StatusNone Duplicate
        Open/ClosedOpen Closed
    2018-05-04 alanrobertclark Attached File- Added plotbug.m, #44084
        Attached File- Added qt.png, #44085
        Attached File- Added bg.dat, #44086
        Attached File- Added gnuplot.png, #44087

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code