octave-maintainers
[Top][All Lists]
Advanced

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

Re: [Changeset] plotyy leaves traces of previous plots


From: Ben Abbott
Subject: Re: [Changeset] plotyy leaves traces of previous plots
Date: Mon, 31 Mar 2008 14:12:44 -0700

On Monday, March 31, 2008, at 04:13PM, "Shai Ayal" <address@hidden> wrote:
>On Mon, Mar 31, 2008 at 9:56 PM, David Bateman <address@hidden> wrote:
>>
>> John W. Eaton wrote:
>>  > On 31-Mar-2008, David Bateman wrote:
>>  >
>>  > | The remain issue is whether the manner to detect that the current axis
>>  > | handle points to one of a plotyy set of axes handles is correct. I used
>>  > | the activepositionproperty of the axis to do this, but I'm not sure this
>>  > | is valid. So I'd appreciate feedback from Michael or Shai if you have
>>  > | some advice on this point..
>>  >
>>  > Matlab's documentation for newplot suggests that all it looks at is
>>  > the nexplot property of the current figure and the current axes, and
>>  > also the handlevisibility propery of the children of the current
>>  > figure and axes objects.  It's not clear to me whether we can do more
>>  > than that in the newplot function and have compatible behavior (which
>>  > I realize we don't have now, even before the proposed changes).
>>  >
>>  > jwe
>>  >
>>
>>  Then how does matlab handle the case "plotyy(x1,y1,x2,y3); plot(x3,y3)"?

The "plot(x3,y3)" erases the prior result. The resulting plot only has 1 axis 
object.

However, the version below plots the third curve into the same axis as (x1,y1).

        plotyy(x1,y1,x2,y2); hold on; plot(x3,y3)

>>  Does it create a callback function that reinitializes the other plotyy
>>  axis in  this case. Also how does it tell the difference from the above
>>  case and "plotyy(x1,y1,x2,y2);plotyy(x3,y3,x4,y4)"?

This also clears the axis and produces a new plot (with 2 axis objects, of 
course).

However, the version below plots results in three axis objects with only y1, 
y2, and y4 visible (no y3).

        plotyy(x1,y1,x2,y2); hold on; plotyy(x3,y3,x4,y4)

I did check, and found that all four line objects are present.

Apparently (x1,y1) and (x3,y3) are children of the same axis, with (x2,y2) and 
(x4,y4) having their own axes.

>> I think Michael or
>>  Shai really has to give feedback on this to get it right, though my
>>  proposed change seems to work fine for me..
>
>Well, I really think we should test to see what matlab does in this
>case, and only then decide what we should do. Can anyone test it?
>

The manner in which plotyy responds is very strange to me ... a bug/feature I 
think ;-)

I'd prefer if Octave's version were to not copy this behavior. Rather the 
second plotyy should place (x3,y3) in the 1st axis and (x4,y4) in the second, 
with all four lines visible.

Ben




reply via email to

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