Mapping Toolbox | ![]() ![]() |
Accessing and Manipulating Map Axes Properties
Just as the properties of the underlying standard axes can be accessed and manipulated using the MATLAB commands set
and get
, map axes properties can also be accessed and manipulated using the commands setm
and getm
.
As an example, create a map axes:
Suppose you would like to make the frame lines bordering the map thicker. First you need to determine the current line width of the frame. Access the property value by typing:
Try resetting the line width to four points:
You can set any number of properties simultaneously with setm
. Reduce the line width, change the projection to an Equidistant Cylindrical, and verify the changes:
setm(gca,'FLineWidth',3,'MapProjection','eqdcylin') getm(gca,'FLineWidth') ans = 3 getm(gca,'MapProjection') ans = eqdcylin
To inspect the entire set of map axes properties at their current settings, use the following command:
getm(gca) ans = mapprojection: 'eqdcylin' zone: [] angleunits: 'degrees' aspect: 'normal' falseeasting: [] falsenorthing: [] fixedorient: [] geoid: [1 0] maplatlimit: [-90 90] maplonlimit: [-180 180] mapparallels: 30 nparallels: 1 origin: [0 0 0] scalefactor: [] trimlat: [-90 90] trimlon: [-180 180] frame: 'on' ffill: 100 fedgecolor: [0 0 0] ffacecolor: 'none' flatlimit: [-90 90] flinewidth: 3 flonlimit: [-180 180] grid: 'off' galtitude: Inf gcolor: [0 0 0] glinestyle: ':' glinewidth: 0.5000 mlineexception: [] mlinefill: 100 mlinelimit: [] mlinelocation: 30 mlinevisible: 'on' plineexception: [] plinefill: 100 plinelimit: [] plinelocation: 15 plinevisible: 'on' fontangle: 'normal' fontcolor: [0 0 0] fontname: 'helvetica' fontsize: 9 fontunits: 'points' fontweight: 'normal' labelformat: 'compass' labelunits: 'degrees' meridianlabel: 'off' mlabellocation: 30 mlabelparallel: 90 mlabelround: 0 parallellabel: 'off' plabellocation: 15 plabelmeridian: -180 plabelround: 0
Similarly, the possible property values and their defaults can be displayed with the setm
command alone:
setm(gca) AngleUnits[ {degrees} | radians | dms | dm ] Aspect[ {normal} | transverse ] FalseEasting FalseNorthing FixedOrientFixedOrient is a read-only property Geoid MapLatLimit MapLonLimit MapParallels MapProjection NParallelsNParallels is a read-only property Origin ScaleFactor TrimLatTrimLat is a read-only property TrimLonTrimLon is a read-only property Zone Frame[ on | {off} ] FEdgeColor FFaceColor FFill FLatLimit FLineWidth FLonLimit Grid[ on | {off} ] GAltitude GColor GLineStyle[ - | -- | -. | {:} ] GLineWidth MLineException MLineFill MLineLimit MLineLocation MLineVisible[ {on} | off ] PLineException PLineFill PLineLimit PLineLocation PLineVisible[ {on} | off ] FontAngle[ {normal} | italic | oblique ] FontColor FontName FontSize FontUnits[ inches | centimeters | normalized | {points} | pixels ] FontWeight[ {normal} | bold ] LabelFormat[ {compass} | signed | none ] LabelUnits[ {degrees} | radians | dms | dm ] MeridianLabel[ on | {off} ] MLabelLocation MLabelParallel MLabelRound ParallelLabel[ on | {off} ] PLabelLocation PLabelMeridian PLabelRound
Properties can also be displayed individually:
setm(gca,'AngleUnits') AngleUnits[ {degrees} | radians | dms | dm ] setm(gca,'MapProjection') An axes's "MapProjection" property does not have a fixed set of property values. setm(gca,'Frame') Frame[ on | {off} ] setm(gca,'FixedOrient') FixedOrientFixedOrient is a read-only property
![]() | Map Axes | The Map Frame | ![]() |