octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] Re: [bug #30461] legend should work for lines with


From: Rik
Subject: [Octave-bug-tracker] Re: [bug #30461] legend should work for lines with different parents
Date: Mon, 08 Nov 2010 07:24:04 -0800

Ben Abbott wrote:
> Follow-up Comment #24, bug #30461 (project octave):
> 
> David, I'm seeing a problem with the plotyy demo.
> 
> 
> plotyy example 1:
>  clf
>  x = 0:0.1:2*pi; 
>  y1 = sin (x);
>  y2 = exp (x - 1);
>  ax = plotyy (x, y1, x - 1, y2, @plot, @semilogy);
>  xlabel ("X");
>  ylabel (ax(1), "Axis 1");
>  ylabel (ax(2), "Axis 2");
>  axes (ax(1))
>  text (0.5, 0.5, "Left Axis",
>        "color", [0 0 1], "horizontalalignment", "center")
>  axes (ax(2))
>  text (4.5, 80, "Right Axis",
>        "color", [0 0.5 0], "horizontalalignment", "center")
> 
> error: structure has no member `ydata'
> error: evaluating argument list element number 1
> error: invalid empty index list
> 
> 
> I haven't looked at the detail, but I don't see this error if I type these
> commands, but do if I run the demo.
> 
> So this may not be related, to you (or other recent changes to the m-files)
> but I thought it best to check with you before posting to the list.
Ben,

How embarassing.  Using 'hg bisect' it appears that the problem appeared in
changeset 11201:6c8791cb35b1 (__go_draw_axes__.m: Set proper tight axis
limits for log scale.)  This is the patch we both worked on to get "axis
tight" working, particularly for semilogy plots which this demo uses.
David is blameless here.

I get the error from typing the commands at the prompt.  The problem is the
last call to text.  From our patch, I see

  if (ylogscale)
    obj.ydata(obj.ydata<=0) = NaN;
  endif

but not all objects are going to have ydata.  The next bit of code in
__go_draw_axes__.m is a huge switch table based on obj.type.  Perhaps we
need to move this code down into the switch table where it will only affect
objects which actually have ydata.

Cheers,
Rik



reply via email to

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