Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

error bars in log-log scale

512 views
Skip to first unread message

Marco

unread,
Sep 12, 2002, 8:55:41 AM9/12/02
to
Anybody knows how can I plot error bars in a semi- or bi-logarythmic
scale? The command errorbar does not help...


thanx


Marco

Denis Gilbert

unread,
Sep 12, 2002, 9:20:21 AM9/12/02
to

Marco,

you can edit ERRORBAR.M and modify lines 91-92 as follows:

xl = x - tee*x; %modif for semilogx or loglog plot
xr = x + tee*x; %modif for semilogx or loglog plot

and save the file under a new name (e.g. errorbar_log.m)

HTH, Denis.

Marco

unread,
Sep 12, 2002, 1:24:20 PM9/12/02
to
Denis Gilbert wrote:
>
>
> On Thu, 12 Sep 2002 08:55:41 -0400, Marco
<marco_...@yahoo.com> wrote:
>
> Marco,
>
> you can edit ERRORBAR.M and modify lines 91-92 as follows:
>
> xl = x - tee*x; %modif for semilogx or loglog plot
> xr = x + tee*x; %modif for semilogx or loglog plot
>
> and save the file under a new name (e.g. errorbar_log.m)
>
> HTH, Denis.
>


Thank you for your hint, but I'm afraid it doesn't work. I'm just
trying to modify errorbar.m properly...

Denis Gilbert

unread,
Sep 12, 2002, 2:06:57 PM9/12/02
to
Marco wrote:
> Thank you for your hint, but I'm afraid it doesn't work. I'm just
> trying to modify errorbar.m properly...
>


Marco, the fix I proposed solves a commonly encountered problem with
error bars in loglog and semilogx plots, namely that ERRORBAR then
produces error bars with progressively narrower TEES from left to
right. With the fix I suggested, you obtain TEES of uniform width
over the entire abscissa with XScale = 'log'.


Perhaps you should describe the nature of your problem in more
details, and I or someone else could take another stab at it.


Denis.

Marco

unread,
Sep 13, 2002, 6:30:18 AM9/13/02
to
> Marco, the fix I proposed solves a commonly encountered problem with
> error bars in loglog and semilogx plots, namely that ERRORBAR then
> produces error bars with progressively narrower TEES from left to
> right. With the fix I suggested, you obtain TEES of uniform width
> over the entire abscissa with XScale = 'log'.
>
> Perhaps you should describe the nature of your problem in more
> details, and I or someone else could take another stab at it.
>
> Denis.
>


Sorry, Denis, it did not work because I did not put 'loglog' in the
place of 'plot' in the same program (lines 129-130)! The fix you
suggested is the good one, but I think it works better also by
setting tee equal to 0.1 or similar (line 90) so that it will not
depend on the range of x.


Marco

Ondrej

unread,
Mar 19, 2012, 1:23:11 PM3/19/12
to
Marco <marco_...@yahoo.com> wrote in message <eeb21...@WebX.raydaftYaTP>...
This also works:

fig = figure;
errorbar(x,y,l,u);
ax = get(fig,'CurrentAxes');
set(ax,'XScale','log','YScale','log')
0 new messages