bugGNU Octave - Bugs: bug #34462, Current axes should be listed 1st...

 
 

bug #34462: Current axes should be listed 1st in the figure's children

Submitter:  Ben Abbott <bpabbott>
Submitted:  Sun 02 Oct 2011 11:11:32 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Ben Abbott Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 27 Sep 2012 08:48:28 PM UTC, comment #4: 

You are correct.  The problem I saw before is gone.


Ben Abbott <bpabbott>
Group Member
Thu 27 Sep 2012 08:40:42 PM UTC, comment #3: 

Great.  This is the way Octave is already behaving so no need to change.  I will close this report now.

Rik <rik5>
Group administrator
Thu 27 Sep 2012 08:33:41 PM UTC, comment #2: 

Rik,

If a user types


figure ()
plot (rand (3))


(s)he would expect the plot to be placed in the new figure.  To be consistent, the code below should place the plot in the newly created axes.


axes ()
plot (rand (3))


Thus, I think the proper behavior is


htmp = axes ();
axes (htmp);


Ben Abbott <bpabbott>
Group Member
Thu 27 Sep 2012 06:47:41 PM UTC, comment #1: 

Ben, is this still an issue?

According to the Matlab documentation (http://www.mathworks.com/help/matlab/ref/axes.html), axes (h) will definitely set the current axis to h and it will definitely be listed first in the children of the current figure.

What is not clear, and really could be just an implementation decision, is whether axes() by itself should switch the current axis to the newly created one.  In effect, the current code does


htmp = axes ();
axes (htmp);


but it would be easy to save and restore the current axis if that is the desired behavior.


ca = gca ();
axes ();
axes (ca);


Rik <rik5>
Group administrator
Sun 02 Oct 2011 11:11:32 PM UTC, original submission:  

The figure's children appear to be listed in the reverse order they are created. However, if the current axes is changed, it is always listed first. Example below.


clf
h1 = axes

h1 =  174.5165

h2 = axes

h2 =  175.5175

get (gcf, 'children')

ans =

  175.5175
  174.5165

axes (h1)
get (gcf, 'children')

ans =

  174.5165
  175.5175


Perhaps a listener should be added the the "currentaxes" property of each figure as they are created.

Ben Abbott <bpabbott>
Group Member

 

(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 rik5 (Posted a comment)
  • -email is unavailable- added by bpabbott (Submitted the item)
  •  

    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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-09-27 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code