bugGNU Octave - Bugs: bug #34149, calling axis after plotyy sets y2...

 
 

bug #34149: calling axis after plotyy sets y2 but not y2 range

Submitted by:  None
Submitted on:  Sat 27 Aug 2011 10:45:39 AM UTC  
 
Category: Plotting with gnuplotSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: InvalidAssigned to: Ben Abbott <bpabbott>
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 3.4.0
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 08 Feb 2013 01:37:55 PM UTC, comment #4:

No bug, just under-documented,

Your code will work with:

x = 0:0.1:1;
[ax, h1, h2] = plotyy(x,sin(x),x,cos(x))
axes(ax(1))
axis ([0 2 0 1])
axes(ax(2))
axis ([0 2 0 1])

You need to select on which axis you want to set the plot axis limits

Best, R

Romano <romano79>
Fri 02 Sep 2011 01:43:03 AM UTC, comment #3:

plotyy creates two axes (as indicated by the help text).

axis(...) operates on the current axes only.

I tested the example below on both Octave and Matlab.

In both cases, only the x-axis limits for the 2nd (green cos(x)) changed.

Unless there is something I've missed, Octave is behaving as it should.

Perhaps a change in the documentation is merited. I'm open pushing a change. Any suggestions?

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Sat 27 Aug 2011 10:53:35 AM UTC, comment #2:

In a similar way , the result returned by

x=axis

will return y2 limits after call to plotyy.

Anonymous
Sat 27 Aug 2011 10:46:20 AM UTC, comment #1:

sorry for typo in title. ;)

Anonymous
Sat 27 Aug 2011 10:45:39 AM UTC, original submission:

eg.

plotyy(..........);
axis([-18,18,0,3]);

this sets the y2 range but not y1

this seems to be undocumented. doc-axis does not speak of y2 or plotyy but does state that the command sets y axis.

Maybe the doc needs expanding to state what does happen after plotyy() or axis needs correcting to work as declared.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by romano79 (Posted a comment)
  • -unavailable- added by bpabbott (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 12 Sep 2011 01:57:43 AM UTCbpabbottOpen/ClosedOpen=>Closed
    Fri 02 Sep 2011 01:47:27 AM UTCbpabbottAssigned toNone=>bpabbott
    Fri 02 Sep 2011 01:43:03 AM UTCbpabbottItem GroupIncorrect Result=>None
      StatusNone=>Invalid

    Back to the top


    Powered by Savane 3.1-cleanup1