Main Content

View Density of Cellular Tower Placement

This example shows how to use a geographic density plot to view the density of cellular tower placement in California.

Load Cellular Tower Placement Data

Load a table of cellular tower placement data into the workspace. The table includes fields that identify the location of the cellular tower by latitude and longitude, and identify the type of tower.

loadcellularTowers

View the Data as a Geographic Scatter Plot

Plot the cellular tower data using thegeoscatterfunction. In the plot, there are clear areas around San Francisco where the number of towers are too dense to be represented using a scatter plot.

lat = cellularTowers.Latitude;朗= cellularTowers.Longitude; geoscatter(lat,lon,'.') text(gca,37.75,-122.75,'San Francisco','HorizontalAlignment','right')

View the Data as a Geographic Density Plot

The dense area of towers in the San Francisco area can be shown usinggeodensityplot.

geodensityplot(lat,lon) text(gca,37.75,-122.75,'San Francisco','HorizontalAlignment','right')

Create a Density Plot Specifying the Radius

When you create a geographic density plot, by default, the density plot automatically selects a radius value, using the latitude and longitude data. Use theRadiusproperty to manually select a radius in meters.

radiusInMeters = 50e3;% 50 kmgeodensityplot(lat,lon,'Radius',radiusInMeters)

Use axes properties to adjust transparency

When set to'interp', the density plot'sFaceAlphaandFaceColorproperties use theAlphamapandColormapproperties of the underlying geographic axes, respectively. Changing theAlphamapchanges the mapping of the density values to color intensities.

geodensityplot(lat,lon) alphamap(normalize((1:64).^0.5,'range'))

TheAlphaScaleproperty on the geographic axes can also be used to alter the transparency. This property is particularly useful when trying to show where any density is found, rather than highlighting the most dense areas.

figure dp = geodensityplot(lat,lon)
dp =DensityPlot with properties:FaceColor: [0 0.4470 0.7410] FaceAlpha: 'interp' LatitudeData: [1×1193 double] LongitudeData: [1×1193 double] WeightData: [1×0 double] Radius: 1.8291e+04 Show all properties
gx = gca
gx =GeographicAxes with properties:Basemap: 'streets-light' Position: [0.1300 0.1100 0.7750 0.8150] Units: 'normalized' Show all properties
gx.AlphaScale ='log';

UseDensityPlotObject Properties to Specify Color

Add color.

dp.FaceColor ='interp'; colormaphot

See Also

|

Related Topics