Main Content

patchm

Project patches on axesm-based map

Syntax

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

Description

h = patchm(lat,lon,cdata) and h = patchm(lat,lon,cdata,PropertyName,PropertyValue,...) project and display patch (polygon) objects defined by their vertices given in lat and lon on the current axesm-based map. lat and lon must be vectors. The color data, cdata, can be any color data designation supported by the standard MATLAB® patch function. The object handle or handles, h, can be returned.

h = patchm(lat,lon,PropertyName,PropertyValue,...) allows any property name/property value pair supported by patch to be assigned to the patchm object. Except for XData, YData, and ZData, all line properties and styles available through patch are supported by patchm.

h = patchm(lat,lon,z,cdata) and h = patchm(lat,lon,z,cdata, PropertyName,PropertyValue,...) allow the assignment of an altitude, z, to each patch object. The default altitude is z = 0.

Examples

collapse all

Project coastline data as single patch object on a map.

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

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

length(h)
ans = 
1

Tips

How patchm Works

This Mapping Toolbox™ function is very similar to the standard MATLAB patch function. Like its analog, and unlike higher level functions such as fillm and fill3m, patchm adds patch objects to the current axesm-based map regardless of hold state.

When A Patch Is Completely Trimmed Away

Removing graphic objects that fall outside the map frame is called trimming. If, after trimming to the map frame no polygons remain to be seen within it, patchm creates no patches and returns an empty 0-by-1 handle. When this occurs, automatic reprojection of the patch data (by changing the projection or any of its parameters) will not be possible. Instead, after changing the projection, call patchm again.

Version History

Introduced before R2006a

See Also

| |