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