tir, 19 01 2010 kl. 20:26 +0100, skrev Philip Nienhuis:
>  >> It also invokes a stray gnuplot if called with too many arguments.
>  >
>  > I don't quite understand. Could you provide an example?
> 
> If I call dateaxis with -say- 4 arguments, I get an extra empty gnuplot 
> window. IIRC that's what the "return" statement I added around line 72 
> aims to fix.
> 
> (Unless it is intended behaviour to continue execution after a "usage" 
> warning.)

'print_usage' raises an error (not a warning), so the function is
interrupted after the call to 'print_usage'. So, the 'return' statement
is never executed.

The reason why you are seeing a gnuplot window is the call to 'gca'.
I've moved this call after the input checking, which avoids the issue.

>  >> The bug is that argument "startdate" is actually ignored.
>  >
>  > I don't know the code very well, so I can't really comment on this. I
>  > see your change includes
>  >
>  >            ticks = get (h, [ax "tick"]);
>  >         -  ticks = ticks - ticks(1) + startdate;
>  >         +  ## Added by PRN oct 2009
>  >         +  if (~isempty(startdate))         +    ticks = ticks - 
> ticks(1) + startdate;
>  >         +  endif
>  >
>  > I don't, however, see what this does or how it relates  your comment
>  > about 'startdate' being ignored. In the case where 'startdate' is empty
>  > the current code is the same as doing
>  >
>  >   ticks = ticks - ticks (1);
>  >
>  > Isn't that okay?
> 
> (Hmmmm... for me it's also quite a while back....)
> 
> ...but here it is. No it's not okay, at least on my octave-3.2.3_MingW:
> (for clarity I renamed the original dateaxis.m to dateaxis_old.m)
> 
> I made a plot with with x-axis values ranging from 713396 to 719786.
> Then, invoking dateaxis_old ('x'):
> 
> ----------------------------------
> octave-3.2.3.exe: #15 > dateaxis_old ('x')
> error: operator +: nonconformant arguments (op1 is 1x8, op2 is 0x0)
> error: called from:
> error: 
> C:\Programs\Octave\3.2.3_gcc4.4.0\share\octave\packages\financial-0.3.2\dateaxis_old.m
>  
> at line 94, column 9
> ----------------------------------
> 
> So octave doesn't accept an empty value for startdate in the statement

Ah, sorry about that. I added an 'isempty' check around the line
question. As I don't know what this code is supposed to do, it would be
great if somebody could verify that this is the right thing to do.

Søren


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to