Main Content

patchesm

Project patches as individual objects on axesm-based map

Syntax

patchesm(lat,lon,cdata)
patchesm(lat,lon,z,cdata)
patchesm(...,'PropertyName',PropertyValue,...)
h = patchesm(...)

Description

patchesm(lat,lon,cdata) projects 2-D patch objects onto the current axesm-based map. The input latitude and longitude data must be in the same units as specified in the current axesm-based map. The input cdata defines the patch face color. If the input vectors are NaN clipped, then multiple patches are drawn each with a single face. Unlike fillm and fill3m, patchesm will always add the patches to the current map regardless of the current hold state.

patchesm(lat,lon,z,cdata) projects 3-D planar patches at the uniform elevation given by scalar z.

patchesm(...,'PropertyName',PropertyValue,...) uses the patch properties supplied to display the patch. Except for xdata, ydata, and zdata, all patch properties available through patch are supported by patchesm.

h = patchesm(...) returns the handles to the patch objects drawn.

Examples

collapse all

Plot coastline data as distinct patch objects.

load coastlines
axesm sinusoid; 
framem
h = patchesm(coastlat,coastlon,'b');

Figure contains an axes object. The axes object contains 242 objects of type patch.

% Number of objects created.
length(h)
ans = 
241

Tips

Differences between patchesm and patchm

The patchesm function is very similar to the patchm function. The significant difference is that in patchesm, separate patches (delineated by NaNs in the inputs lat and lon) are separated and plotted as distinct patch objects on the current axesm-based map. The advantage to this is that less memory is required. The disadvantage is that multifaced objects cannot be treated as a single object. For example, the archipelago of the Philippines cannot be treated and handled as a single Handle Graphics® object.

When Patches Are Completely Trimmed Away

Removing graphic objects that fall outside the map frame is called trimming. If, after trimming no polygons remain to be seen within it, patchesm creates no patches and returns an empty 1-by-0 list of handles. When this occurs, automatic reprojection of the patch data (by changing the projection or any of its parameters) is not possible. In cases where some polygons are completely trimmed away but not others, handles returned for the trimmed polygons will be empty. No polygons or rings that have been totally trimmed away can be reprojected; to plot them again, you will need to call patchesm again with the original data.

Version History

Introduced before R2006a

See Also

| | |