Documentation Center

  • Trial Software
  • Product Updates

patchesm

Project patches on map axes as individual objects

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

Examples

load coast
axesm sinusoid; framem
h = patchesm(lat,long,'b');

length(h)

ans =
   238

More About

expand all

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 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

| | |

Was this topic helpful?