Home > mapstuff > mapax.m

mapax

PURPOSE ^

MAPAX Puts degrees and minutes on map axes instead of decimal degrees

SYNOPSIS ^

function []=mapax(nminlong,ndiglong,nminlat,ndiglat);

DESCRIPTION ^

   MAPAX  Puts degrees and minutes on map axes instead of decimal degrees

   Usage: mapax(nnminlong,ndiglong,nminlat,ndiglat);

   Inputs:
          nminlon  = minutes of spacing between longitude labels
          ndiglong = number of decimal places for longitude minute label

          nminlon  = minutes of spacing between latitude labels
          ndiglong = number of decimal places for latitude minute label

 Example:  mapax(15,1,20,0);   
               labels lon every 15 minutes with 1 decimal place (eg 70 40.1')
           and labels lat every 20 minutes with no decimal place (eg 42 20')

 Version 1.0 Rocky Geyer  (rgeyer@whoi.edu)
 Version 1.1 J. List (6/5/95) had apparent bug with
  ndigit being set to 0: routine degmins blows up.
  Fixed by adding arguments specifying number of decimal
  digits (can vary from 0 to 2)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function []=mapax(nminlong,ndiglong,nminlat,ndiglat);
0002 
0003 %   MAPAX  Puts degrees and minutes on map axes instead of decimal degrees
0004 %
0005 %   Usage: mapax(nnminlong,ndiglong,nminlat,ndiglat);
0006 %
0007 %   Inputs:
0008 %          nminlon  = minutes of spacing between longitude labels
0009 %          ndiglong = number of decimal places for longitude minute label
0010 %
0011 %          nminlon  = minutes of spacing between latitude labels
0012 %          ndiglong = number of decimal places for latitude minute label
0013 %
0014 % Example:  mapax(15,1,20,0);
0015 %               labels lon every 15 minutes with 1 decimal place (eg 70 40.1')
0016 %           and labels lat every 20 minutes with no decimal place (eg 42 20')
0017 %
0018 % Version 1.0 Rocky Geyer  (rgeyer@whoi.edu)
0019 % Version 1.1 J. List (6/5/95) had apparent bug with
0020 %  ndigit being set to 0: routine degmins blows up.
0021 %  Fixed by adding arguments specifying number of decimal
0022 %  digits (can vary from 0 to 2)
0023 
0024 nfaclong=60/nminlong;
0025 nfaclat=60/nminlat;
0026 
0027 if nminlong>0;
0028 
0029 xlim=get(gca,'xlim');
0030 xlim(1)=floor(xlim(1)*nfaclong)/nfaclong;
0031 xtick=xlim(1):1/nfaclong:xlim(2);
0032 set(gca,'xtick',xtick);
0033 
0034 % modified 6/5/95 J.List:
0035 
0036 xticklab=degmins(-xtick,ndiglong);
0037 
0038 set(gca,'xticklabels',xticklab);
0039 
0040 end;
0041 
0042 
0043 if nminlat>0;
0044 
0045 ylim=get(gca,'ylim');
0046 ylim(1)=floor(ylim(1)*nfaclat)/nfaclat;
0047 ytick=ylim(1):1/nfaclat:ylim(2);
0048 set(gca,'ytick',ytick);
0049 
0050 % modified 6/5/95 J.List:
0051 
0052 yticklab=degmins(-ytick,ndiglat);
0053 
0054 set(gca,'yticklabels',yticklab);
0055 
0056 end;

Generated on Wed 30-Nov-2005 15:38:18 by m2html © 2003