function fixcontourlabels( t1 );
% function fixcontourlabels( t1 );
%
% The routines [ c, h ] = contour() and [ c, h ] = contourf()
% put in labels that are rotated.  Fix that.
% 
% [ c, h ] = contour();
% t1 = clabel( c, 'Rotation', 0 );
% provides you with the "t1" that is input to this function
% Todd Mitchell, August 2016
%

% "t1" has an even number of rows, and each label is associated with
% two rows of information.  For shading labels, I turn off the + mark by setting the 
% "Marker" attribute to "none"; extract the + mark position from the
% first row; and modify the label, including its position, in the second row.
for icnt = 1: length(t1)/2
    set( t1((icnt-1)*2+1), 'Marker', 'none' )
    XData = get( t1((icnt-1)*2+1), 'XData' );
    YData = get( t1((icnt-1)*2+1), 'YData' );
    set( t1((icnt-1)*2+2), 'Position', [ XData YData 0 ] );
    set( t1((icnt-1)*2+2), 'HorizontalAlignment', 'center' );
    set( t1((icnt-1)*2+2), 'VerticalAlignment', 'middle' );
end

