function[]=tick_geo(ln,fs,ax)
%---------------------------------------------
% show E-W long and S-N lat in the ticklabels 
% ln linewidth for axis, default 1.5
% fs fontsize, deafult 12
% ax='xy','x','y' axis to be affected, default='xy'
% upper case means xyrev case: 
% tick_geo(1,12,'X') change x-labels assuming that x-axis is latitude
% tick_geo(1,12,'x') change x-labels assuming that x-axis is longitude
% v0.22 by senya@atmos.umd.edu (add char(176) as explained by Rick)
%
% %doesn't work in 7.4-7.6 for EPS and PS output %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% works in 7.7
%----------------------------------------------
deg=char(176);
%deg='';
if (nargin==0)
    ln=1.5;
    fs=12;
    ax='xy';
end
if (nargin==1)
    fs=12;
    ax='xy'
end
if (nargin==2)
    ax='xy'
end

tx=cellstr(get(gca,'xticklabel'));set(gca,'xtick',str2num(char(tx)));
ty=cellstr(get(gca,'yticklabel'));set(gca,'ytick',str2num(char(ty)));

if sum(ax=='x')>=1 
for i=1:length(tx)
ctx=char(tx(i));
if(length(ctx)~=0)
    if(ctx(1)=='-')
        nlon=str2num(ctx);
        if (nlon<-180)
            nlon=nlon+360;
        end
        clon=num2str(nlon);
        %tx(i)=cellstr([ctx(2:end) deg 'W']);
        if nlon>=0
            tx(i)=cellstr([clon deg 'E']);
        else
        tx(i)=cellstr([clon(2:end) deg 'W']);
        end
    else
        nlon=str2num(ctx);
        if (nlon>360)
            nlon=nlon-360;
        end
        clon=num2str(nlon);
        %tx(i)=cellstr([ctx deg 'E']);
        tx(i)=cellstr([clon deg 'E']);
    end
end
end

set(gca,'xticklabel',tx)
end %if

if sum(ax=='y')>=1 
for i=1:length(ty)
   cty=char(ty(i));
if (length(cty)~=0)
    if(cty(1)=='-')
        ty(i)=cellstr([cty(2:end) deg 'S']);
    end
    if(cty(1)=='0')
        ty(i)=cellstr('EQ');
    end
    if(cty(1)~='-' & cty(1)~='0')
        ty(i)=cellstr([cty deg 'N']);
    end
end
end

set(gca,'yticklabel',ty)
end %if

if sum(ax=='X')>=1 
for i=1:length(tx)
ctx=char(tx(i));
if(length(ctx)~=0)
if(ctx(1)=='-')
        tx(i)=cellstr([ctx(2:end) deg 'S']);
    end
    if(ctx(1)=='0')
        tx(i)=cellstr('EQ');
    end
    if(ctx(1)~='-' & ctx(1)~='0')
        tx(i)=cellstr([ctx deg 'N']);
    end    
end
end

set(gca,'xticklabel',tx)
end %if

if sum(ax=='Y')>=1 
for i=1:length(ty)
   cty=char(ty(i));
if (length(cty)~=0)
if(cty(1)=='-')
        ty(i)=cellstr([cty(2:end) deg 'W']);
    else
        ty(i)=cellstr([cty deg 'E']);
    end
    
end
end

set(gca,'yticklabel',ty)
end %if


set(gca,'fontweight','bold','linewidth',ln,'fontsize',fs,'layer','top','box','on')

