close all
clear all
opt = menu('Choose test', 'x axis is year', 'x axis is days', ...
    'y axis is year', 'y axis is days', 'time from csiro routine julian');
switch opt
  case 1
    x = 0:.01:1.52;
    y = sin(4*pi*x);
    
    figure
    plot(x, y)
    grid
    label_month
    
    figure
    plot(x, y)
    grid
    label_month(0, 1+1/6)
    
    figure
    plot(x, y)
    grid
    label_month(NaN, NaN, 1)
    
    figure
    plot(x, y)
    grid
    label_month([], [], 1)
    
    x = 0:.1:10.5;
    y = sin(4*pi*x);
    
    figure
    plot(x, y)
    grid
    label_month(0, 10)
    
  case 2
    x = 50:870;
    y = sin(2*pi*x/350);
    
    figure
    plot(x, y)
    grid
    label_month(NaN, NaN, 1, '1-January-1988')
    
    figure
    plot(x, y)
    grid
    label_month(NaN, 600, 1, datenum('3-January-1988'))
       
    figure
    plot(x, y)
    grid
    label_month(min(x), max(x), 1, datenum('3-August-1988'))
    
    figure
    plot(x, y)
    grid
    label_month(min(x), 730, 1, datenum('3-January-1988'))
    
    figure
    plot(x, y)
    grid
    label_month(min(x), 720, 1, datenum('3-January-1988'))
    
    x = 50:2000;
    y = sin(2*pi*x/350);
    
    figure
    plot(x, y)
    grid
    label_month(NaN, NaN, 1, '1-January-1988')
    
    x = 50:5000;
    y = sin(2*pi*x/350);
    
    figure
    plot(x, y)
    grid
    label_month(NaN, NaN, 1, '1-January-1988')
    
    str1 = '17-Oct-1983 17:20:00';
    str2 = '06-Apr-1985 14:30:00';
    serial1 = datenum(str1);
    serial2 = datenum(str2);
    x = serial1:serial2;
    y = sin(x/100);
    
    figure
    plot(x, y)
    grid
    label_month([], [], [], 0)
        
    figure
    plot(x, y)
    grid
    label_month(NaN, NaN, 1, [])
    
    figure
    x = peaks;
    x(3, 4) = NaN;
    flat_pcolor(x)
    label_month(NaN, NaN, 1, [])
    
    figure
    x = peaks;
    x(3, 4) = NaN;
    flat_pcolor(x)
    label_month([], [], 1, [])
    
    figure
    x = peaks;
    x(3, 4) = NaN;
    flat_pcolor(x)
    label_month(0.5, 49.5, 1, [])
    
  case 3
    x = 0:.01:1.52;
    y = sin(4*pi*x);
    
    figure
    plot(y, x)
    grid
    label_month(0, 1+1/6, 0)
    
    figure
    plot(y, x)
    grid
    label_month(NaN, NaN, 0)
    
    figure
    plot(y, x)
    grid
    label_month([], [], 0)
    
    x = 0:.1:10.5;
    y = sin(4*pi*x);
    
    figure
    plot(y, x)
    grid
    label_month(0, 10, 0)
    
  case 4
    x = 50:870;
    y = sin(2*pi*x/350);
    
    figure
    plot(y, x)
    grid
    label_month(NaN, NaN, 0, '1-January-1988')
    
    figure
    plot(y, x)
    grid
    label_month(NaN, 600, 0, datenum('1-January-1988'))
    
    figure
    plot(y, x)
    axis('ij')
    grid
    label_month(NaN, 600, 0, datenum('1-January-1988'))
    
    figure
    plot(y, x)
    grid
    label_month(NaN, NaN, 0, '1-January-1988')
    
    figure
    plot(y, x)
    grid
    label_month(NaN, 600, 0, datenum('3-January-1988'))
       
    figure
    plot(y, x)
    grid
    label_month(min(x), max(x), 0, datenum('3-August-1988'))
    
    figure
    plot(y, x)
    grid
    label_month(min(x), 730, 0, datenum('3-January-1988'))
    
    figure
    plot(y, x)
    grid
    label_month(min(x), 720, 0, datenum('3-January-1988'))
    
    x = 50:2000;
    y = sin(2*pi*x/350);
    
    figure
    plot(y, x)
    grid
    label_month(NaN, NaN, 0, '1-January-1988')
    
    x = 50:5000;
    y = sin(2*pi*x/350);
    
    figure
    plot(y, x)
    grid
    label_month(NaN, NaN, 0, '1-January-1988')
    
    str1 = '17-Oct-1983 17:20:00';
    str2 = '06-Apr-1985 14:30:00';
    serial1 = datenum(str1);
    serial2 = datenum(str2);
    x = serial1:serial2;
    y = sin(x/100);
    
    figure
    plot(y, x)
    grid
    label_month([], [], 0, 0)
        
    figure
    plot(y, x)
    grid
    label_month(NaN, NaN, 0, [])
        
    x(3) = NaN;
    y(3) = NaN;
    figure
    plot(y, x)
    grid
    label_month(NaN, NaN, 0, [])
    
    figure
    x = peaks;
    x(3, 4) = NaN;
    flat_pcolor(x)
    label_month(NaN, NaN, 0, [])
    
    figure
    x = peaks;
    x(3, 4) = NaN;
    flat_pcolor(x)
    label_month([], [], 0, [])
    
    figure
    x = peaks;
    x(3, 4) = NaN;
    flat_pcolor(x)
    label_month(0.5, 49.5, 0, [])
    
  case 5
    x = julian(1988, 1, 3, 0) + (0:900);
    y = sin(2*pi*x/350);
    
    figure
    plot(x, y)
    grid
    label_month(NaN, NaN, 1, 'julian')
    
    figure
    plot(x, y)
    grid
    label_month(NaN, x(600), 1, 'julian')
    
    x = julian(1988, 1, 3, 0) + (0:0.01:30);
    y = sin(2*pi*x/5);
    
    figure
    plot(x, y)
    grid
    label_month(NaN, NaN, 1, 'julian')
end
