bugGNU Octave - Bugs: bug #46168, OpenGL use of single causing...

 
 

bug #46168: OpenGL use of single causing problems in errorbar

Submitter:  José Luis García Pallero <jgpallero>
Submitted:  Fri 09 Oct 2015 10:04:49 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Postponed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 4.0.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 09 Oct 2015 11:20:41 PM UTC, comment #1: 

I don't think the problem is errorbar.  I think you're running into the fact that OpenGL uses class single to represent numbers.  If I switch to gnuplot for plotting, which uses doubles to represent numbers, then the plot looks alright.


graphics_toolkit gnuplot
x=[2000.59 2000.60 2000.61];
y=[0.00 2.10 -2.70];
ey=[1.36 2.49 2.79];
errorbar(x,y,ey,'.');
print('test_errorbar.pdf','-dpdf');


It's not the fact that the numbers are close together, it's the fact that you're asking for a precision of .01 / 2000 or 5 parts per million.  An easy way around this is to scale the numbers.  See below.


x=[2000.59 2000.60 2000.61];
x = x - 2000;
y=[0.00 2.10 -2.70];
ey=[1.36 2.49 2.79];
errorbar(x,y,ey,'.');


If you want the plot to actually read correctly you can change the xticklabel property on the axis manually.  Assuming the code above,


set (gca, "xtick", [0.59, 0.60, 0.61]);
set (gca, "xticklabel", {"2000.59", "2000.60", "2000.61"});



Rik <rik5>
Group administrator
Fri 09 Oct 2015 10:04:49 PM UTC, original submission:  

When I plot this data


x=[2000.59 2000.60 2000.61];
y=[0.00 2.10 -2.70];
ey=[1.36 2.49 2.79];
errorbar(x,y,ey,'.');
print('test_errorbar.pdf','-dpdf');


the obtained plot is inaccurate because the vertical lines do not match the point symbol and also there are problems with the horizontal ticks at the vertical lines extremes. I attach a PDF file with the plot made with my Octave 4.0.0 on Debian.

The problem is present only when the X coodinates of the points are near each other

José Luis García Pallero <jgpallero>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35128:  test_errorbar.pdf added by jgpallero (3KiB - application/text-plain:formatted)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jgpallero (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-10-09 rik5 StatusNone Postponed
    2015-10-09 rik5 CategoryPlotting Plotting with OpenGL
        SummaryBug in errorbar() when X coordinates are near each other OpenGL use of single causing problems in errorbar
    2015-10-09 jgpallero Attached File- Added test_errorbar.pdf, #35128

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code