help-octave
[Top][All Lists]
Advanced

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

Re: plotyy broken in 3.6.1?


From: Ben Abbott
Subject: Re: plotyy broken in 3.6.1?
Date: Sun, 20 May 2012 14:22:40 -0400

On May 20, 2012, at 2:10 AM, marco atzeri wrote:

> On 5/20/2012 1:54 AM, notMyUsername wrote:
>> Greetings,
>> 
>> I am having an issue when using 'plotyy()' in a subplot.  When I plot
>> something in a subplot of a figure and then attempt to plotyy() into another
>> subplot of that figure the correct y-axes are displayed, but only one of the
>> two curves is displayed.  I can sometimes see the other curve flash in the
>> subplot I am plotyy()-ing to but it immediately disappears when the second
>> curve is displayed.  The following test code seems to reproduce the issue
>> for me:
>> 
>>    clear
>>    figure(1)
>>    clf
>> 
>>    t=[0:1/1000:1];
>>    x=sin(2*pi*t);
>>    y=5*cos(2*pi*t);
>> 
>>    figure(1);
>>    subplot(3,1,1);
>>    hold on
>>    title('x(t)')
>>    plot(t,x);
>> 
>>    subplot(3,1,2)
>>    hold on
>>    title('y(y)')
>>    plot(t,y);
>> 
>>    subplot(3,1,3)
>>    hold on
>>    title('x(t), y(y)')
>>    plotyy(t,x,t,y);
>> 
>> Here is what I see when I run this:
>> http://octave.1599824.n4.nabble.com/file/n4629948/Screen_shot_2012-05-19_at_7.41.57_PM.png
>> 
>> What I expect to see is both x(t) and y(t) plotted together in
>> subplot(3,1,3), each with its own y-axis.
>> 
>> If I don't use subplots plotyy() seems to work OK.
>> 
>> Am I doing something wrong or is plotyy() broken in 3.6.1?
>> 
>> Octave 3.6.1 from Homebrew
>> OS X 10.6.8
> 
> it seems broken, the second curve cover the first one.
> Please open a bug report
> 
> http://www.gnu.org/software/octave/bugs.html
> 
> I notice that without hold the curves are correctly plotted
> 
> clear
>   figure(1)
>   clf
> 
>   t=[0:1/1000:1];
>   x=sin(2*pi*t);
>   y=5*cos(2*pi*t);
> 
>   figure(1);
>   subplot(3,1,1);
>   title('x(t)')
>   plot(t,x);
> 
>   subplot(3,1,2)
>   title('y(y)')
>   plot(t,y);
> 
>   subplot(3,1,3)
>   title('x(t), y(y)')
>   plotyy(t,x,t,y);

I pushed a fix.

        http://hg.savannah.gnu.org/hgweb/octave/rev/161d06a52360

Ben



reply via email to

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