octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tests in log-scale plots


From: Ben Abbott
Subject: Re: tests in log-scale plots
Date: Tue, 06 Sep 2011 20:30:41 -0400

On Sep 6, 2011, at 8:48 AM, Carlo de Falco wrote:

> %!test
> %! a = logspace (-5, 1, 10);
> %! b =-logspace (-5, 1, 10);
> %! loglog (a, b)
> 
> catches a bug occurring in all the functions semilogx/semilogy/loglog in 
> octave <http://savannah.gnu.org/bugs/?33249>, 
> while in matlab it is (almost) equivalent to
> 
> loglog (a, abs(b), 'ydir', 'reverse')
> set (gca, 'ydir', 'reverse')

Just for clarity, I ran this in Matlab and attached a plot (loglog-demo-2.dpf).

I noticed that 'ydir', isn't reversed. Instead Matlab made some bizarre choices.

>> a = logspace (-5, 1, 10);
>> b =-logspace (-5, 1, 10);
>> loglog(a,b)
>> get (gca, 'ydir')

ans =

normal

>> get (gca, 'ytick')

ans =

  -10.0000   -1.0000   -0.1000   -0.0100   -0.0010   -0.0001   -0.0000

>> get (gca, 'yticklabel')

ans =

1 
0 
-1
-2
-3
-4
-5

Ben

Attachment: loglog-demo-2.pdf
Description: Adobe PDF document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]