bugGNU Octave - Bugs: bug #51251, gca should accept figure handle...

 
 

bug #51251: gca should accept figure handle argument

Submitter:  None
Submitted:  Fri 16 Jun 2017 06:28:58 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Wont Fix Assigned to:  None
Originator Name:  Marshall Floyd Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.1
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 18 Jun 2017 12:28:09 AM UTC, comment #3: 

Matlab does have lots of behavior which is undocumented.  In general, Octave doesn't try to follow undocumented Matlab because it can change from release to release with no warning or deprecation.

Rik <rik5>
Group administrator
Sun 18 Jun 2017 12:07:36 AM UTC, comment #2: 

I wasn't sure initially whether to put this under matlab compatibility or a feature request, so that's ok.  but in any case I had tested before that +verbatim+ gca(5) -verbatim- does get the current axis of figure 5 in matlab with the default gca function. You are right though that it is not documented apparently, so I'm not sure exactly how I found out that usage. I have been using it for a while in matlab.

Marshall <marsian>
Fri 16 Jun 2017 07:06:56 PM UTC, comment #1: 

This seems to be a feature request rather than a Matlab compatibility issue.  According to The Mathworks documentation, gca does not accept an argument (http://www.mathworks.com/help/matlab/ref/gca.html).

It is probably best to continue to use your own version of gca.

Rik <rik5>
Group administrator
Fri 16 Jun 2017 06:28:58 PM UTC, original submission:  

It would be nice if gca would take an optional argument of the figure handle to get the current axis for. I've used this in Matlab and find it rather useful when there are many figures.

Here's my fix that would make it work the way I want/expect:


function h = gca (f = gcf)

  if (nargin <= 1)
    h = get (f, "currentaxes");
    if (isempty (h))
      h = axes ("parent",f);
    endif
  else
    print_usage ();
  endif

endfunction


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 marsian (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-13 rik5 StatusNone Wont Fix
        Open/ClosedOpen Closed
    2017-06-16 rik5 Item GroupMatlab Compatibility Feature Request

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code