project

Project displayed map graphics object

project will be removed in a future release.

Syntax

project(h)
project(h,'xy')
project(h,'yx')

Description

project(h) takes unprojected objects with handles h that are displayed on map axes and projects them. For example, project takes a line created on a map axes with the plot function and projects it as though it had been created with the plotm function. This can be useful if a standard MATLAB® function was accidentally executed. The map structure of the existing map axes determines the specifics of the projection. If h is the handle of the map axes, then all the children of h are projected. Do not attempt this if any children of h have already been projected!

project(h,'xy') specifies that the XData of the unprojected objects corresponds to longitudes and the YData to latitudes. This is the default assumption.

project(h,'yx') specifies that the XData of the unprojected objects corresponds to latitudes and the YData to longitudes.

Examples

Create an axes, plot a line, then project it:

axesm('bonne','AngleUnits','radians');framem;
h = plot([-1 -.5 0 .5 1],[-1 -.5  0 .5 1]);

project(h) 

The line is straight in x-y space, but when converted to a projected map object, it bends with the projection.

Was this topic helpful?