%
% function to tailor dual Y axes
%
function axesyy( h, lim, labx, laby1, laby2, remticlab, ytic1, ytic2 )
%
% rescale and label left axis plot
set( h(1), 'XLim', lim(1:2) );
set( h(1), 'fontsize', 24 );
set( h(1), 'YLim', lim(3:4) );
sylabel( [ '\24' laby1 ] );
%
% rescale and label right axis plot
set( h(2), 'XLim', lim(1:2) );
set( h(2), 'fontsize', 24 );
set( h(2), 'YLim', lim(5:6) );
sy2label( h(2), [ '\24' laby2 ] );
%
% label x axis
sxlabel( [ '\24' labx ] );
%
if remticlab == 1
   for hi = 1:2,
      % remove even tick labels from axis
      a = get( h( hi ), 'YTickLabel' );
      [ n, m ] = size( a );
      for i = 2:2:n,
         a(i,:) = blanks( m );
      end;
      set( h( hi ), 'YTickLabel', a );
   end;
end;
%
% set up specified y axes tick marks and labels
if remticlab == 2
   set( h(1), 'YTick', ytic1 );
   lab = str2mat( num2str( ytic1(1) ) );
   for i = 2:length( ytic1 ),
      lab = str2mat( lab, num2str( ytic1(i) ) );
   end;
   set( h(1), 'YTickLabel', lab );
   set( h(2), 'YTick', ytic2 );
   lab = str2mat( num2str( ytic2(1) ) );
   for i = 2:length( ytic2 ),
      lab = str2mat( lab, num2str( ytic2(i) ) );
   end;
   set( h(2), 'YTickLabel', lab );
end;
%

