MathGroup Archive 1998

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

Search the Archive

Re: Error Bars


  • To: mathgroup@smc.vnet.net
  • Subject: [mg10927] Re: Error Bars
  • From: Paul Abbott <paul@physics.uwa.edu.au>
  • Date: Thu, 12 Feb 1998 20:16:09 -0500
  • Organization: University of Western Australia
  • References: <6br6vm$dkc@smc.vnet.net>

Gernot August Weber wrote:

>  i need to draw error bars in mathematica. is there any possibility
> without writing an own routine?
> 
> please mail to:
> 
> gweber@student.physik.uni-mainz.de

Recently there was another posting related to this topic by Ben Yung
<benyung@unixg.ubc.ca>.  Here was my reply to Ben:

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]:=
yerror=Table[{-1,1}Random[]/3,{Length[data]}];

(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}]];

Cheers,
	Paul
 
____________________________________________________________________ 
Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia            Nedlands WA  6907       
mailto:paul@physics.uwa.edu.au  AUSTRALIA                            
http://www.pd.uwa.edu.au/~paul

            God IS a weakly left-handed dice player
____________________________________________________________________



  • Prev by Date: Re: output to a file
  • Next by Date: Re: ListPlot and List problem
  • Prev by thread: Re: Error Bars
  • Next by thread: Thank you