function adddeg(ax,dir)

% adddeg(axis handle, which axis)
% i.e.  adddeg(gca,'x') adds degree symbols to the x axis of the current 
% figure.

if strcmp(dir,'x')
 lab = get(ax,'xticklabel');
else
 lab = get(ax,'yticklabel');
end

for l=1:length(lab)
  nulab{l} = sprintf('%d%c',sscanf(lab(l,:),'%d'),setstr(176));
end

if strcmp(dir,'x')
 set(ax,'xticklabel',nulab);
else
 set(ax,'yticklabel',nulab);
end
