bugGNU Octave - Bugs: bug #49205, Rename hidden properties such as...

 
 

bug #49205: Rename hidden properties such as image "clim" to "__clim__"

Submitter:  Dan Sebald <sebald>
Submitted:  Wed 28 Sep 2016 08:34:58 AM UTC
   
 
Category:  Plotting Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 14 Oct 2016 10:46:48 PM UTC, comment #5: 

I renamed some of the obvious Octave-only properties to have underscores, or more closely match Matlab's own hidden property names.

See http://hg.savannah.gnu.org/hgweb/octave/rev/4191f8b5070c.
See http://hg.savannah.gnu.org/hgweb/octave/rev/76f1164d2135.

This still leaves the more delicate work of renaming the hidden "alim", "clim", "xlim", "ylim", and "zlim" properties for the image, patch, surface, and hggroup objects.

Rik <rik5>
Group administrator
Tue 11 Oct 2016 08:16:09 PM UTC, comment #4: 

We have to be careful.  Many "hidden" properties are also hidden in Matlab, but they are so well known that people expect to find them under the same names.  Examples include 'xliminclude', 'looseinset', 'x_viewtransform'.  Properties which strictly belong to octave, like 'fltk_label', should be renamed to have underscores.

Can someone run the following in Matlab to see if these properties are known in Matlab?


close all
figure
hi = image (0:64);
get (hi, 'foobar')   % This should fail
get (hi, 'xdatamode')
get (hi, 'ydatamode')
clf
ht = text (2,2, 'Hello World');
get (ht, 'positionmode')
get (ht, 'rotationmode')
get (ht, 'horizontalalignmentmode')
get (ht, 'verticalalignmentmode')



Rik <rik5>
Group administrator
Wed 28 Sep 2016 03:57:54 PM UTC, comment #3: 

Yes, you are right that it is easy to mistakenly get an image "clim" instead of its parent axes'. Renaming hidden properties would avoid confusion.
I'll retitle this report and make it a feature request.

Pantxo Diribarne <pantxo>
Group Member
Wed 28 Sep 2016 03:25:17 PM UTC, comment #2: 

OK, this hidden property rings a bell.  Probably using something like _clim_, _xlim_, etc. for the internal property name would have been better, as it is very easy for someone to stumble upon the object clim, xlim, etc.

Looking at graphics.cc, I'm guessing that these x/y/clim object properties are

min_val, max_val, min_pos, max_neg

So a max_neg of -Inf means there are no negative numbers in the data.

Dan Sebald <sebald>
Wed 28 Sep 2016 09:35:42 AM UTC, comment #1: 

"clim" image property is an internal, hidden, non-documented, non matlab compatible property, see:


h = image ();
props = fieldnames (get (h));
any (strcmp (props, "clim"))
## -> 0



"clim" is used internally to compute the image parent axes limits, but is not meant to be used outside the graphics engine. So I think this report can be closed.

Pantxo Diribarne <pantxo>
Group Member
Wed 28 Sep 2016 08:34:58 AM UTC, original submission:  

With the following set of commands there is a clim that has four elements, but I think only two elements are valid (toolkit doesn't matter):


octave:1> graphics_toolkit ('qt')
octave:2> x = uint8 ((1:128)' + (1:128));
octave:3> y = repmat (x, 1, 1, 3);
octave:4> imshow (y)
octave:5> kids = get(gca, 'children')
kids = -6.9685
octave:6> get(kids(1),'clim')
ans =

     2   255     2  -Inf


The 2 and 255 seem correct.  I don't know what 2 -Inf might represent.  Out of curiosity:


octave:7> get(gca,'clim')
ans =

     0   255


Dan Sebald <sebald>

 

(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 pantxo (Posted a comment)
  • -email is unavailable- added by sebald (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-08-17 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2016-09-28 pantxo Severity3 - Normal 1 - Wish
        Item GroupIncorrect Result Feature Request
        Summaryclim has four elements for imshow() result Rename hidden properties such as image "clim" to "__clim__"

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code