This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Project patches on map axes as individual objects


h = patchesm(...)


patchesm(lat,lon,cdata) projects 2-D patch objects onto the current map axes. The input latitude and longitude data must be in the same units as specified in the current map axes. 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.


collapse all

Plot coastline data as distinct patch objects.

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

% Number of objects created.
ans = 241


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 map axes. 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.

See Also

| | |

Introduced before R2006a

Was this topic helpful?