bugGNU Octave - Bugs: bug #50652, ytickformat function missing

 
 

bug #50652: ytickformat function missing

Submitter:  CH <atcl>
Submitted:  Mon 27 Mar 2017 11:55:04 AM UTC
   
 
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 12 May 2020 01:17:28 PM UTC, comment #6: 

The "xaxis", "yaxis" and "zaxis" axes properties have been added as part of bug #58336.
The "numericruler" graphics object itself has not been implemented yet though.

Markus Mützel <mmuetzel>
Group administrator
  Spam posted by papatyak
Fri 07 Apr 2017 03:16:53 PM UTC, comment #4: 

An easier approach for this specific functionality might be to add a (hidden?) property "XTickLabelFormat" to the axes object and use this when automatically creating the tick labels (and respectively for the y and z axes).

The "XTickLabel" axes property etc. are still present in Matlab R2016a. And I guess Matlab cannot remove them, or else they would break a lot of stuff. They probably will continue to re-route those NumericRuler properties to the axes properties.
We could re-route "XTickLabelFormat" as well if we eventually decided to implement NumericRuler objects (or HG2???).
Would that be an acceptable language extension?

Markus Mützel <mmuetzel>
Group administrator
Thu 06 Apr 2017 09:25:36 PM UTC, comment #3: 

It appears that The Mathworks significantly changed the way graphic objects are implemented when they switched to Handle Graphics 2 (HG2).  Previously, the axes object itself had properties for each axis so there was an "xcolor" property and an "xticklabel" property, etc., etc.

Now, it seems that the axes object has properties "Xaxis", "Yaxis", "Zaxis" which point to NumericRuler objects.  Octave could make this change as well, but this is a big project.

Rik <rik5>
Group administrator
Tue 04 Apr 2017 05:15:24 PM UTC, comment #2: 

The final function should probably also include a listener to the axes limits. See this example in Matlab R2016a:

>> ha = gca;
>> ha.XAxis.TickLabelFormat = '$%.2f';
>> ha.XTickLabel

ans =

    '$1.18'
    '$1.20'
    '$1.22'
    '$1.24'
    '$1.26'
    '$1.28'
    '$1.30'
    '$1.32'

>> xlim([0 1])
>> ha.XTickLabel

ans =

    '$0.00'
    '$0.10'
    '$0.20'
    '$0.30'
    '$0.40'
    '$0.50'
    '$0.60'
    '$0.70'
    '$0.80'
    '$0.90'
    '$1.00'


Matlab seems to have added more granular control to each individual axis of an axes object:
https://de.mathworks.com/help/matlab/ref/numericruler-properties.html

Most of those properties are duplicates to the ones present in the axes (that have a preceding "X", "Y" or "Z"). But some of them seem to be new.

Markus Mützel <mmuetzel>
Group administrator
Mon 27 Mar 2017 05:13:10 PM UTC, comment #1: 

Confirmed.  Changed Release to dev and Severity to Minor since there is an obvious workaround.  This function could be easily added for the next 4.4 release, although it would need to have documentation as well as the trivial implementation shown.

Rik <rik5>
Group administrator
Mon 27 Mar 2017 11:55:04 AM UTC, original submission:  

Matlab introduced a ytickformat(formatstring) command in version 2016b, this command can be easily included in Octave using this mailinglist solution: http://octave.1599824.n4.nabble.com/Tick-label-format-and-color-td4674571.html or as a one-liner:



ytickformat @(f) set(gca,'yticklabel',arrayfun(@(x) sprintf(f,x),get(gca,'ytick'),'UniformOutput',false));


CH <atcl>

 

(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 papatyak (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by atcl (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-27 mtmiller CategoryPlotting Octave Function
        Severity2 - Minor 1 - Wish
        Priority5 - Normal 3 - Low
        Item GroupMatlab Compatibility Feature Request
    2017-03-27 rik5 Severity3 - Normal 2 - Minor
        StatusNone Confirmed
        Release4.0.0 dev
        Summaryytickformat ytickformat function missing

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code