| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Mapping Toolbox |
| Contents | Index |
| Learn more about Mapping Toolbox |
mdistort
mdistort off
mdistort(parameter)
mdistort parameter
mdistort(parameter,levels)
mdistort(parameter,levels,gsize)
[h,ht] = mdistort(...)
mdistort, with no input arguments, toggles the display of contours of projection-induced distortion on the current map axes. The magnitude of the distortion is reported in percent.
mdistort off removes the contours.
mdistort(parameter) or mdistort parameter displays contours of distortion for the specified parameter. Recognized parameter strings are 'area', 'angles' for the maximum angular distortion of right angles, 'scale' or 'maxscale' for the maximum scale, 'minscale' for the minimum scale, 'parscale' for scale along the parallels, 'merscale' for scale along the meridians, and 'scaleratio' for the ratio of maximum and minimum scale. If omitted, the 'maxscale' parameter is displayed. All parameters are displayed as percent distortion except angles, which are displayed in degrees.
mdistort(parameter,levels) specifies the levels for which the contours are drawn. levels is a vector of values as used by contour. If empty, the default levels are used.
mdistort(parameter,levels,gsize) controls the size of the underlying graticule matrix used to compute the contours. gsize is a two-element vector containing the number of rows and columns. If omitted, the default Mapping Toolbox graticule size of [50 100] is assumed.
[h,ht] = mdistort(...) returns the handles to the line and text objects.
Map projections inevitably introduce distortions in the shape and size of objects as they are transformed from three-dimensional spherical coordinates to two-dimensional Cartesian coordinates. The amount and type of distortion vary between projections, over the projection, and with the selection of projection parameters such as standard parallels. This function provides a quantitative graphical display of distortion parameters.
mdistort is not intended for use with UTM. Distortion is minimal within a given UTM zone. mdistort issues a warning if a UTM projection is encountered.
Note the extreme area distortion of the Mercator projection. This makes it ill-suited for global displays.
figure axesm mercator load coast framem;plotm(lat, long,'color',.5*[1 1 1]) mdistort area

The lines of zero distortion for the Bonne projection follow the central meridian and the standard parallel.
figure axesm bonne load coast framem;plotm(lat, long,'color',.5*[1 1 1]) mdistort angles parallelui

An equidistant conic projection with properly chosen parallels can map the conterminous United States with less than 1.5% distortion.
figure
usamap conus
load conus
patchm(uslat, uslon, [1 0.7 0])
plotm(statelat, statelon)
patchm(gtlakelat, gtlakelon, 'cyan')
framem off; gridm off; mlabel off; plabel off
mdistort('parscale', -2:.2:2)
parallelui

mdistort can help in the placement of standard parallels for projections. Standard parallels are generally placed to minimize distortion over the region of interest. The default parallel locations might not be appropriate for maps of smaller regions. By using mdistort and parallelui, you can immediately see how the movement of parallels reduces distortion.
![]() | mapview | meanm | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |