Mapping Toolbox    
histr

Create spatial equirectangular histogram

Syntax

Description

This command sorts geographic data into equirectangular bins for histogram purposes. Equirectangular in this context means that each bin has the same angular measurement on each side (e.g., 1º-by-1º). Consequently, the result is not an equal area histogram. The hista command provides that capability. However, the results of histr can be weighted by their area bias to, in some sense, correct for this.

[lat,lon,num,wnum] = histr(lats,lons) returns the center coordinates of equal-rectangular bins and the number of observations, num, falling in each based on the geographically distributed input data. Additionally, an area-weighted observation value, wnum, is returned. wnum is the bin's num divided by its normalized area. The largest bin has the same num and wnum; a smaller bins has a larger wnum than num.

[lat,lon,num,wnum] = histr(lats,lons,units) specifies the standard angle unit string. The default value is 'degrees'.

[lat,lon,num,wnum] = histr(lats,lons,bindensty) sets the number of bins per angular unit. For example, if units are 'degrees', a bindensty of 10 would be 10 bins per degree of latitude or longitude, resulting in 100 bins per square degree. The default is one cell per angular unit.

Examples

Create random data:

Bin the data in 0.5-by-0.5 degree cells (2 bins per degree):

The bins centered at 0.75°N are slightly smaller in area than the others. wnum reflects the relative count per normalized unit area.

See Also
filterm
Geographic filter for data sets
hista
Spatial equal area histogram


  hista hms2hm