bugGNU Octave - Bugs: bug #51839, new matlab functions for axis tick...

 
 

bug #51839: new matlab functions for axis tick position, values, labels

Submitter:  Nicholas Jankowski <nrjank>
Submitted:  Thu 24 Aug 2017 03:08:00 PM UTC
   
 
Category:  Plotting Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Nicholas Jankowski Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 03 Nov 2023 06:27:21 PM UTC, comment #9: 

noting that I opened patch #10408 with the intent of providing some manner of rticklabels and tticklabels functionality for octave polar plots.

Nicholas Jankowski <nrjank>
Group Member
Tue 19 Sep 2017 04:32:58 AM UTC, comment #8: 

I modified the patch a bit.  The m-files had CRLF endings so I stripped those down to just LF.  I also added some BIST tests to validate the inputs.  Thanks a lot for doing heavy lifting on this task.

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Wed 30 Aug 2017 06:11:42 PM UTC, comment #7: 

patch attached. adds 8 functions from previously attached zip to /scripts/plot/appearance, updates module.mk, adds sections to plot.txi, and added new function names to NEWS

(file #41702)

Nicholas Jankowski <nrjank>
Group Member
Tue 29 Aug 2017 08:54:56 PM UTC, comment #6: 

x y and z ticklabel functions zipped and attached, along with tweaked versions of the others. will put a patch up shortly once I make the doc file edits.

(file #41694)

Nicholas Jankowski <nrjank>
Group Member
Fri 25 Aug 2017 05:51:12 PM UTC, comment #5: 

haven't made a patch yet, but attached are first cuts at xticks.m, yticks.m, zticks.m, rticks.m, and thetaticks.m.

Note that the current polar implementation does not create a mode property for rtick and ttick.  so that functionality is disabled and produces an error with appropriate message.

also, noticed that there also is not an equivalent rticklabel, tticklabel property, so implementing those functions will have to wait. I would doubt it would be useful to implement dummyfunctions simply stating that 'this functionality does not exist yet...'

(file #41654, file #41655, file #41656, file #41657)

Nicholas Jankowski <nrjank>
Group Member
Thu 24 Aug 2017 08:47:26 PM UTC, comment #4: 

ahh, ok.  I think I tried get(gca) on a polar plot and just saw the xtick and ytick definitions. I didn't scroll up far enough to see that it did add an rtick and ttick.

I doubt there's any issue if octave's rtick and thetatick don't produce errors for a polar() plot. Matlab errors for calling rtick on a cartesian axis, including polar(). similarly, xtick errors calling on a polarplot() but not on a polar. 

assuming we eventually make a compatible polaraxes object, the only issue is that matlab calls their axis property thetatick instead of ttick. should be able to have the wrapper check for and return either.

Nicholas Jankowski <nrjank>
Group Member
Thu 24 Aug 2017 07:45:36 PM UTC, comment #3: 

Not quite sure if this is what you mean, but take a look at the %!demos in polar.m.  For example, the third one makes use of the rtick and ttick properties.


%!demo
%! clf;
%! theta = linspace (0,2*pi,1000);
%! rho = sin (2*theta).*cos (2*theta);
%! polar (theta, rho, "--r");
%! set (gca, "rtick", 0.1:0.1:0.6, "ttick", 0:20:340);
%! title ("polar() plot with finer grid");


Eventually Octave should implement a polaraxes object which is separate from a regular axes object.  In the short term, however, the hggroup which implements the polar axes could be updated so that at least the property names like "thetatick" are the same as Matlab.

Rik <rik5>
Group administrator
Thu 24 Aug 2017 05:58:17 PM UTC, comment #2: 

does octave have any current implementation of a plotting function that would use the r and theta tick functions?

Nicholas Jankowski <nrjank>
Group Member
Thu 24 Aug 2017 03:50:05 PM UTC, comment #1: 

I'm marking this as a Wish list item.  It isn't that hard to create an m-file wrapper around set (...) to implement these functions.  If anyone submits something I'll review.

Rik <rik5>
Group administrator
Thu 24 Aug 2017 03:08:00 PM UTC, original submission:  

appears along with 2016b came a few new ways of getting and setting axis properties.

xticks
yticks
zticks
rticks
thetaticks
xticklabels
yticklabels
zticklabels
thetaticklabels
rticklabels

it appears from the documentation that each function without argument would simply act as get(gca,'xticks'), etc., so an alias for nargin=0 should be easy enough to make as a set of wrappers, at least for x, y and z. polar still describes the axis with cartesian coordinates, and we don't seem to have polarplot implemented yet which uses r and theta axes.  using r and thetaticks on 'polar' gives an error about 'rticks is not supported for Cartesian axes. use xticks instead', and similar when calling xticks on a plot created polarplot.

each of the above do take a number of arguments that will either modify the 'get' or will perform a 'set' for the particular element.  documentation below:

https://www.mathworks.com/help/matlab/ref/xticks.html

Nicholas Jankowski <nrjank>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #41702:  add_tickfunctions.diff added by nrjank (44KiB - application/octet-stream)
file #41694:  comment6_files.zip added by nrjank (15KiB - application/x-zip-compressed - 'final' tick and label m-files for x, y, z, r, and theta)
file #41658:  thetaticks.m added by nrjank (4KiB - text/plain)
file #41654:  xticks.m added by nrjank (4KiB - text/plain)
file #41655:  yticks.m added by nrjank (4KiB - text/plain)
file #41656:  zticks.m added by nrjank (4KiB - text/plain)
file #41657:  rticks.m added by nrjank (4KiB - text/plain)

 

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 nrjank (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 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-19 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-08-30 nrjank Attached File- Added add_tickfunctions.diff, #41702
    2017-08-29 nrjank Attached File- Added comment6_files.zip, #41694
    2017-08-25 nrjank Attached File- Added thetaticks.m, #41658
    2017-08-25 nrjank Attached File- Added xticks.m, #41654
        Attached File- Added yticks.m, #41655
        Attached File- Added zticks.m, #41656
        Attached File- Added rticks.m, #41657
    2017-08-24 rik5 StatusNone Confirmed
    2017-08-24 rik5 Severity3 - Normal 1 - Wish
        Release4.2.1 dev

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code