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: Kai Habel
Subject: Re: tests in log-scale plots
Date: Tue, 06 Sep 2011 15:06:54 +0200

-------- Original-Nachricht --------
> Datum: Tue, 6 Sep 2011 14:48:36 +0200
> Von: Carlo de Falco <address@hidden>
> An: address@hidden
> Betreff: tests in log-scale plots

> 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.
> 
> 

Hello Carlo,

you are right, I think a lot of test are possible for the graphic function when 
using a hidden figure. I have recently commited some test for the scripts in 
the plot directory. 

Take a look at: http://hg.savannah.gnu.org/hgweb/octave/rev/5553412c6614
e.g. line.m

Kai


reply via email to

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