bugGNU Octave - Bugs: bug #39727, datetick gives ..., 1699, 1720, ...

 
 

bug #39727: datetick gives ..., 1699, 1720, ...

Submitter:  Muhali <muhali>
Submitted:  Thu 08 Aug 2013 11:08:42 AM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 12 Nov 2016 11:36:17 PM UTC, comment #2: 

I finally fixed this issue with this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/ee34028f63fc).  The case of spacing by months had a similar issue which I also fixed.

Closing report.

Rik <rik5>
Group administrator
Fri 09 Aug 2013 07:45:34 AM UTC, comment #1: 

I confirm this behavior for 3.6.2. The problem is around line 195 of datetick.m. The separation sep is computed from minyear and maxyear (line 189), but the ticks are computed from the corresponding datenum. But, because of leap years (I think), the original separation (20 in this case) is lost. So, the ticks should be computed in the same if branch.


sep = __calc_tick_sep__ (minyear , maxyear);
xmin = datenum (sep * floor (minyear / sep), 1, 1);
xmax = datenum (sep * ceil (maxyear / sep), 1, 1);
nticks = ceil (maxyear / sep) - floor (minyear / sep) + 1;
[minyear, ~] = datevec (xmin);
[maxyear, ~] = datevec (xmax);
rangeyear = (minyear:sep:maxyear)';
ticks = datenum([rangeyear,ones(rows(rangeyear),2)]);


I think a similar problem should occur when computing separations between months (previous if branch).

Marco

Marco Caliari <caliari>
Group Member
Thu 08 Aug 2013 11:08:42 AM UTC, original submission:  

This example


d = [(1600:1750)' repmat(1, 151, 2)] ;
plot(datenum(d), ones(151,1)) ;
datetick(gca) ;


produces dateticks ...,1699, 1720,... (instead of ..., 1700, 1720, ...).

Muhali <muhali>

 

(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 caliari (Posted a comment)
  • -email is unavailable- added by muhali (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-12 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code