bugGNU Octave - Bugs: bug #30998, errorbar connects points lines

 
 

bug #30998: errorbar connects points lines

Submitter:  None
Submitted:  Wed 08 Sep 2010 06:06:30 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  bpabbott
Originator Name:  sven Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.2.4
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 25 Oct 2010 09:03:19 PM UTC, comment #9: 

@ben and @Jess

I tried the code you proposed but got unreliable results (using Octave 3.2.4 ).
This (allegedly even uglier hack) works much more reliable for me.

eb=errorbar(LX,LY,EX,EY, '#~>k*');
h = findobj( findobj (eb, 'type', 'line'),'udata',[]);
delete(h)

Though I don't know what "udata" is it seemed to be pretty much the only property that separated the dots from the line when looking at them with the get function.

Simon Albinsson <zinob>
Fri 22 Oct 2010 07:33:49 PM UTC, comment #8: 

My apologies, John; in the heat of the moment (with my students demanding explanations) I may have expressed myself too abruptly.  In case there is any residual confusion about the undesirability of connecting the points in an errorbar plot, let me explain: usually only data have error bars (uncertainties), and (for the same reason) the data points will be scattered by amounts roughly equal to the uncertainties.  Therefore connecting the points will always produce a jagged line, never a smooth curve, which is the domain of theory.  Furthermore, if for some reason one DID want the points connected up, this is easily added in another plot command.  So the connected line should be removed by default, don't you agree? 

I am pleased to know that this will be corrected in the next release, and thanks to Ben for his proposed fix for the time being.  I won't attempt to explain it to my students, though, because they already feel I am asking too much of them -- most are still terrified of the command line, never mind actual coding.  Hopefully Octave will "catch" and they will become future contributors, but for now it's all I can do to keep them trying. 

Keep up the good work, folks!  If I ever get up to your level I will be delighted to chip in with solutions of my own.

Jess H. Brewer <jhbrewer>
Fri 22 Oct 2010 02:16:04 AM UTC, comment #7: 

@jhbrewer:  FWIW, messages like yours tend to make me less likely to want work on Octave.  Please remember that everyone who works on Octave is a volunteer.  If you want something fixed, then help fix it instead of just complaining about it and expecting others to fix it immediately for you for free.

John W. Eaton <jwe>
Group administrator
Fri 22 Oct 2010 12:45:46 AM UTC, comment #6: 

Regarding "connecting the dots", that line is intended to represent the nominal curve. I assume in your case the the "dots" represent experimental data, whose nominal values are different from the theoretical ones.

A quick fix is to create the error bars, extract the handles for the line objects and then delete the line you don't want.

    hg = errorbar (1:10, 1);
    h = findobj (hg, "type", "line");
    delete (h(1));

Now you can add the theoretical curve by ...

    hold on
    plot (...)

The next release of Octave will have the bug this page is tracking fixed.

Ben Abbott <bpabbott>
Group Member
Thu 21 Oct 2010 11:39:40 PM UTC, comment #5: 

I am trying to sell my students (50 of them) on octave, but this bug (ALWAYS connecting the dots) makes it impossible to use errorbar to plot actual data with error bars and then draw a theory line through it -- i.e. what they all need to do.  Frankly, I cannot imagine any circumstances where one would WANT to connect the dots in such a plot; unconnected points should be the default!  The students are in revolt at being forced to use etc. etc.  This needs fixing pronto.

Jess H. Brewer <jhbrewer>
Sat 16 Oct 2010 10:45:39 AM UTC, comment #4: 

I've pushed a change to the developer's sources that allows the normal linetype and color to be specified.

http://hg.savannah.gnu.org/hgweb/octave/rev/65b240770880

Slight changes to the help and demos are included.

Ben Abbott <bpabbott>
Group Member
Wed 13 Oct 2010 07:43:12 PM UTC, comment #3: 

I am having this same problem; even simple format arguments such as 'g' or '*' cause this error.  Finally, although various errorbar types ("#", ">", "~") work without error, there does not seem to be any visual difference between these types.

Anonymous
Fri 24 Sep 2010 09:49:09 PM UTC, comment #2: 

The help says:

"If the FMT argument is supplied, it is interpreted as in normal plots."

But since connected points in an error bar plot are extremely bad style for us physicists, how does one change this behaviour. I'm pretty sure it worked well in former versions.

Anonymous
Wed 08 Sep 2010 08:30:21 PM UTC, comment #1: 

I may be missing something, but the syntax that produced the error isn't documented. An error is given by Matlab as well.


Ben Abbott <bpabbott>
Group Member
Wed 08 Sep 2010 06:06:30 PM UTC, original submission:  

Octave: 3.2.4
Gnuplot: 4.4.0octave-mingw32

Example:

x = [1:10]
y = x;
ey = ones(1,10);
errorbar(x,y,ey);

The points are connected and in the fmt option only parameters for the errorbars are accepted, e.g. "~". So the display of the points and the plot style cannot be modified:

errorbar(x,y,ey, "@12~")
error: `n' undefined near line 59 column 33
error: invalid limit value in colon expression
error: evaluating argument list element number 1
error: called from:
error:   C:ProgrammeOctave3.2.4_gcc-4.4.0shareoctave3.2.4mplot__pltopt1
__.m at line 59, column 25
error:   C:ProgrammeOctave3.2.4_gcc-4.4.0shareoctave3.2.4mplot__pltopt_
_.m at line 113, column 28
error:   C:ProgrammeOctave3.2.4_gcc-4.4.0shareoctave3.2.4mplot__errplot
__.m at line 35, column 15
error:   C:ProgrammeOctave3.2.4_gcc-4.4.0shareoctave3.2.4mplot__errcomm
__.m at line 54, column 16
error:   C:ProgrammeOctave3.2.4_gcc-4.4.0shareoctave3.2.4mploterrorbar.
m at line 131, column 5

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #21601:  __errplot__.m added by None (6KiB - text/x-objcsrc - Here I've fixed the issue.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by zinob (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jhbrewer (Posted a comment)
  • -email is unavailable- added by bpabbott (Posted a comment)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2010-10-18 bpabbott StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2010-10-16 bpabbott StatusNone Patch Submitted
        Assigned toNone bpabbott
    2010-10-03 None Attached File- Added _errplot_.m, #21601

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code