octave-maintainers
[Top][All Lists]
Advanced

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

tests in log-scale plots


From: Carlo de Falco
Subject: tests in log-scale plots
Date: Tue, 6 Sep 2011 14:48:36 +0200

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.




reply via email to

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