comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Horizontal error bars
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Horizontal error bars [message #10784] Wed, 28 January 1998 00:00 Go to next message
Inigo Garcia is currently offline  Inigo Garcia
Messages: 13
Registered: June 1997
Junior Member
Hi:

Does anyone out there have any routine to plot error bars in the X axis
?
I need to plot both errors in X and Y, and I don't see the way of doing
it.

Thanks,

I~nigo.
--
\\|//
(o o)
+-----------------------oOOo-(_)-oOOo----------------------- --+
| I~nigo Garcia Ruiz |
| Kapteyn Instituut Phone: +31-(0)50-3634083 |
| Landleven 12 Fax: +31-(0)50-3636100 |
| 9747 AD GRONINGEN (Netherlands) e-mail: iruiz@astro.rug.nl |
+----------------------------------------------------------- --+
Re: Horizontal error bars [message #10850 is a reply to message #10784] Mon, 16 February 1998 00:00 Go to previous message
Martin Cartwright is currently offline  Martin Cartwright
Messages: 1
Registered: February 1998
Junior Member
St�phane Erard wrote:
>
> In article <34CF53FB.D019E9CA@astro.rug.nl>, I~nigo Garcia
> <iruiz@astro.rug.nl> wrote:
>
>> Hi:
>>
>> Does anyone out there have any routine to plot error bars in the X axis
>> ?
>> I need to plot both errors in X and Y, and I don't see the way of doing
>> it.
>
> Yep: the most useful one is called Errbars and is part of the Meron
> library, that was distributed with IDL 3.6 (stil available on RSI site).
>

There's also a very useful routine called PLOTERR that comes from the
idl astonomy library that you can find at idlastro.gsfc.nasa.gov


--
M.Cartwright@qub.ac.uk --- http://star.pst.qub.ac.uk/~imc/vom.htm

"Sponges grow in the ocean ... I wonder how much deeper
the ocean would be if that didn't happen."
Re: Horizontal error bars [message #10934 is a reply to message #10784] Tue, 03 February 1998 00:00 Go to previous message
Erard is currently offline  Erard
Messages: 11
Registered: November 1997
Junior Member
In article <34CF53FB.D019E9CA@astro.rug.nl>, I~nigo Garcia
<iruiz@astro.rug.nl> wrote:

> Hi:
>
> Does anyone out there have any routine to plot error bars in the X axis
> ?
> I need to plot both errors in X and Y, and I don't see the way of doing
> it.


Yep: the most useful one is called Errbars and is part of the Meron
library, that was distributed with IDL 3.6 (stil available on RSI site).

--
St�phane Erard
Institut d'Astrophysique Spatiale
Orsay, France
Re: Horizontal error bars [message #10974 is a reply to message #10784] Thu, 29 January 1998 00:00 Go to previous message
Inigo Garcia is currently offline  Inigo Garcia
Messages: 13
Registered: June 1997
Junior Member
Hi again:

First, thank you Martin for your routine. Second, while trying it I
typed oploterr by accident, and it works !!! Even if it is not
documented (at least I haven't seen it), it draws x-axis error bars.

I~nigo.
--
\\|//
(o o)
+-----------------------oOOo-(_)-oOOo----------------------- --+
| I~nigo Garcia Ruiz |
| Kapteyn Instituut Phone: +31-(0)50-3634083 |
| Landleven 12 Fax: +31-(0)50-3636100 |
| 9747 AD GRONINGEN (Netherlands) e-mail: iruiz@astro.rug.nl |
+----------------------------------------------------------- --+
Re: Horizontal error bars [message #10979 is a reply to message #10784] Wed, 28 January 1998 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
I~nigo Garcia wrote:
>
> Hi:
>
> Does anyone out there have any routine to plot error bars in the X axis
> ?
> I need to plot both errors in X and Y, and I don't see the way of doing
> it.
>
> Thanks,
>
> I~nigo.
> --

Here's a simple one (not too fancy, but it does what you ask for,
and you should be able to go along from this peace of code:

The program expects a vector with symmetric error values which must
have the same number of elements as x and y do. The _EXTRA keyword
allows you to pass on every fancy thing that PLOTS can handle
without having to worry about it in the routine. Before overlaying
the error bars, you must plot your data with the PLOT command
(or even better: 1st: plot the axis only with PLOT,...,/NODATA
2nd: overlay the error bars
3rd: overlay the symbols )

Hope this helps,
Martin.

------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
IDL-homepage: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ -------


pro oploterrxy,x,y,xerr,yerr,psym=psym,_EXTRA=e

xlo = x-xerr
xhi = x+xerr
ylo = y-yerr
yhi = y+yerr

; clipping (not done in plots !)
xlo = xlo > !x.crange(0)
xhi = xhi < !x.crange(1)
ylo = ylo > !y.crange(0)
yhi = yhi < !y.crange(1)


for i=0,n_elements(x)-1 do begin
plots,[xlo(i),xhi(i)],[y(i),y(i)],_EXTRA=e
plots,[x(i),x(i)],[ylo(i),yhi(i)],_EXTRA=e
endfor

return
end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: transparent routine using either readu or assoc for same array variable
Next Topic: pricing

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:33:49 PDT 2025

Total time taken to generate the page: 0.00457 seconds