Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: question on ErrorBar

  • To:
  • Subject: [mg10924] Re: question on ErrorBar
  • From: Paul Abbott <>
  • Date: Thu, 12 Feb 1998 20:16:06 -0500
  • Organization: University of Western Australia
  • References: <6brgk6$>

Ben Yung wrote:

> I'm having trouble with using the ErrorBar option in the
> MultipleListPlot.  I have a list of datapoints {x,y}, as well as a 
> list of errors {xerror, yerror}.  The syntax is as follows:
> MultipleListPlot[{{x1,y1},ErrorBar[{xerror1,yerror1}]},{{x2,y2},
> {{x2,y2},ErrorBar[{xerror2,yerror2}]},{etc.....}]

I think you mean ErrorBar[{x1, x2}, {y1, y2}] here.
> Is their a convenient way to input my two lists?

Here is one way:

In[1]:= data=Table[{x,Sin[x]},{x,0.,3,0.5}];

Generate two lists of errors:

In[2]:= xerror=Table[{-1,1}Random[]/3,{Length[data]}]; In[3]:=

(I have symmetric errors generated by direct multiplication by {-1,1}.

In[4]:= <<Graphics`MultipleListPlot`

Here are the errorbars

In[5]:= errorbars= Apply[ErrorBar,Transpose[{xerror,yerror}],{1}];

Now we can write

In[6]:= MultipleListPlot[Transpose[{data,errorbars}]];


Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia            Nedlands WA  6907  AUSTRALIA                   

            God IS a weakly left-handed dice player

  • Prev by Date: Re: Re: How to change the argument of a function?
  • Next by Date: Re: Random Order of a Set of Numbers
  • Prev by thread: Re: question on ErrorBar
  • Next by thread: Version 3 Foramtting question