Home > omviz > gregaxy.m

gregaxy

PURPOSE ^

GREGAXY Labels the current x-axis with Gregorian labels in units of years.

SYNOPSIS ^

function []=gregaxy(jd,yeartic);

DESCRIPTION ^

 GREGAXY Labels the current x-axis with Gregorian labels in units of years.
      GREGAXY(JD,YEARTIC) draws Gregorian time labels on the x-axis in
      intervals of YEARTIC days.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function []=gregaxy(jd,yeartic);
0002 % GREGAXY Labels the current x-axis with Gregorian labels in units of years.
0003 %      GREGAXY(JD,YEARTIC) draws Gregorian time labels on the x-axis in
0004 %      intervals of YEARTIC days.
0005 
0006 % Rich Signell
0007 n=length(jd);
0008 start=gregorian(jd(1));
0009 stop=gregorian(jd(n));
0010 start=[start(1) 0 0 0 0 0];
0011 stop=[stop(1)+1 0 0 0 0 0];
0012 jd0=julian(start);
0013 jd1=julian(stop);
0014 %xlim=[jd0-180 jd1+180];
0015 %set(gca,'xlim',xlim);
0016 ylim=get(gca,'ylim');  
0017 %
0018 year=[start(1):yeartic:stop(1)]';
0019 n=length(year);
0020 greg=[year ones(n,2) zeros(n,3)];
0021 jdtic=julian(greg);
0022 
0023 %
0024 % find year labels
0025 %
0026 yearticlab=sprintf('%4.4d',year');
0027 nyear=length(year);
0028 yearticlab=reshape(yearticlab,4,nyear)';
0029 set(gca,'xtick',jdtic,'Xticklabels',yearticlab)
0030 xlabel('Year')
0031 %

Generated on Thu 01-Dec-2005 08:50:35 by m2html © 2003