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

 
 

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

Submitted by:  Nicholas Jankowski <nrjank>
Submitted on:  Thu 24 Aug 2017 03:08:00 PM UTC  
 
Category: PlottingSeverity: 1 - Wish
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Nicholas JankowskiOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

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>
Project 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>
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>
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>
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>
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.

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>
Project 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>
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>
Project 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>

 

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

Attach File(s):
   
   
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
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by nrjank (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 12 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 19 Sep 2017 04:32:58 AM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Wed 30 Aug 2017 06:11:42 PM UTCnrjankAttached File-=>Added add_tickfunctions.diff, #41702
    Tue 29 Aug 2017 08:54:56 PM UTCnrjankAttached File-=>Added comment6_files.zip, #41694
    Fri 25 Aug 2017 05:51:53 PM UTCnrjankAttached File-=>Added thetaticks.m, #41658
    Fri 25 Aug 2017 05:51:12 PM UTCnrjankAttached File-=>Added xticks.m, #41654
      Attached File-=>Added yticks.m, #41655
      Attached File-=>Added zticks.m, #41656
      Attached File-=>Added rticks.m, #41657
    Thu 24 Aug 2017 03:50:15 PM UTCrik5StatusNone=>Confirmed
    Thu 24 Aug 2017 03:50:05 PM UTCrik5Severity3 - Normal=>1 - Wish
      Release4.2.1=>dev

    Back to the top


    Powered by Savane 3.1-cleanup1