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 09:07:24 -0400

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

> the log-scale plotting functions (semilogx/semilogy/loglog) were removed from 
> the test statistics with
> 
> ## Remove from test statistics.  No real tests possible.
> %!assert (1)
> 
> actually a test is indeed possible, for example the following:
> 
> %!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')
> 
> woud it make sense to add the test above to semilogx/semilogy/loglog or maybe 
> a demo like the following?
> 
> %!demo
> %! 
> %! a = logspace (-5, 1, 10);
> %! b =-logspace (-5, 1, 10);
> %! 
> %! subplot (1, 2, 1)
> %! loglog (a, b)
> %! xlabel ('loglog (a, b)')
> %! 
> %! subplot (1, 2, 2)
> %! loglog (a, abs (b))
> %! set (gca, 'ydir', 'reverse')
> %! xlabel ('loglog (a, abs (b))')
> %! 
> %! fprintf ('the two plots should look the same except for the sign in y tick 
> labels')
> %!
> 
> c.

I'm off-topic, but for the graphics demos please start with a "clf ()" to 
ensure reproducible results.

Ben




reply via email to

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