Mapping Toolbox | ![]() ![]() |
Projected and Unprojected Objects
All objects displayed using Mapping Toolbox commands are projected on the map axes based on their designated latitude-longitude positions. The latitudes and longitudes are mathematically transformed to x and y positions using the formulas for the current map projection. Objects displayed using standard MATLAB commands (like plot
, fill
, surface
, and text
) are placed in the designated x-y location. If the projection changes for a map axes (for example, by using the setm
command to alter the MapProjection
property), those objects displayed with standard commands are unaffected, but those displayed using mapping commands are reprojected into new positions. Here is an example:
This set of commands creates a map axes, a map frame enclosing the region of interest, and geographic grid lines. The x-y axes, which are normally hidden, are displayed, and the MATLAB x-y grid is turned off. It should be noted that the MATLAB x-y grid
is separate from the Mapping Toolbox geographic version gridm
.
Here, a standard text object is placed at x=0.5 and y=-1, while a mapped text object has been placed at (60°N,150°W) in the Miller projection.
If we change the projection to a Sinusoidal, the standard text object remains at the same Cartesian position, so its latitude-longitude position is altered. The mapped text object remains at the same geographic location, so its x-y position is altered. Also, the frame and gridlines are replaced according to the new map projection:
Similarly, vector and matrix data can be displayed using either mapping or standard commands.
![]() | Switching Between Projections | Displaying Vector Maps as Lines | ![]() |