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

 
 

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

Submitter:  None
Submitted:  Sat 27 Aug 2011 10:45:39 AM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Invalid / Not an Octave Bug Assigned to:  bpabbott
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.4.0
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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.


>> x = 0:0.1:1;
>> plotyy(x,sin(x),x,cos(x))
>> axis ([0 2 0 1])


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>
Group Member
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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-09-12 bpabbott Open/ClosedOpen Closed
    2011-09-02 bpabbott Assigned toNone bpabbott
    2011-09-02 bpabbott Item GroupIncorrect Result None
        StatusNone Invalid / Not an Octave Bug

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code