MathWorks® offers a selection of basemaps for use with geographic axes and charts.
The basemaps provide a variety of map options, including two-tone, color terrain, and
high-zoom-level displays. Six of the basemaps are tiled data sets created using
Natural Earth. Five of the basemaps are high-zoom-level maps hosted by Esri®. For more information about basemap options, see
To specify a basemap for your geographic axes or chart, you can either:
Basemap property of the
MATLAB® includes one installed basemap, a two-tone map named
'darkwater'. Use of this basemap does not require Internet
access. Use of the other basemaps, including the default basemap
'streets-light', does require Internet access.
If you do not have reliable access to the Internet, or want to improve map
responsiveness, you can plot using the
'darkwater' basemap or
download a selection of basemaps onto your local system.
'darkwater'on Geographic Plots
To display the
'darkwater' basemap while plotting with functions such as
lat1 = [33.448 29.424 32.716 32.777 37.338]; lon1 = [-112.074 -98.494 -117.161 -96.797 -121.886]; geoscatter(lat1,lon1,'*') geobasemap darkwater
Alternatively, you can create a set of geographic axes and specify the
Basemap name-value pair. To maintain the basemap, use the
hold on command before plotting.
figure lat2 = [40.713 34.052 41.878 29.760 39.952]; lon2 = [-74.006 -118.244 -87.630 -95.370 -75.165]; geoaxes('Basemap','darkwater') hold on geoscatter(lat2,lon2,'*')
You can also change the default basemap for all plots created with
geodensityplot during your MATLAB session.
'darkwater'on Geographic Bubble Charts
'darkwater' on a geographic bubble chart, call
geobubble using the
'Basemap' name-value pair.
tsunamis = readtable('tsunamis.xlsx'); geobubble(tsunamis,'Latitude','Longitude','Basemap','darkwater')
Alternatively, you can specify the basemap by using
counties = readtable('counties.xlsx'); geobubble(counties,'Latitude','Longitude') geobasemap darkwater
Download basemaps onto your local system using the Add-On Explorer. The five high-zoom-level basemaps provided by Esri are not available for download.
On the MATLAB Home tab, in the Environment section, click Add-Ons > Get Add-Ons.
In the Add-On Explorer, scroll to the MathWorks Optional Features section, and click show all to find the basemap packages. You can also search for the basemap add-ons by name (listed in the following table) or click Optional Features in Filter by Type.
Select the basemap data packages that you want to download.
|Basemap Name||Basemap Data Package Name|
|MATLAB Basemap Data - bluegreen|
|MATLAB Basemap Data - grayland|
|MATLAB Basemap Data - colorterrain|
|MATLAB Basemap Data - grayterrain|
|MATLAB Basemap Data - landcover|
When you access a basemap over the Internet, MATLAB improves performance by temporarily caching the basemap tiles. With this caching behavior, the program has to download each tile only once as you pan and zoom within the map. If you lose your connection to the Internet, you can still view parts of the map that you have already viewed, because the map tiles are stored locally.
When you are not connected to the Internet and you attempt to view a part of the
map that you have not previously viewed, tiles for these areas are not in your
cache. For the basemaps created using Natural Earth, the program replaces missing tiles with tiles from the
For the high-zoom-level basemaps provided by Esri, the program caches a limited number of tiles and the cached tiles
expire after a limited time. If you attempt to view a region of a high-zoom-level
basemap that is not cached, you see blank map tiles. The geographic chart does not
use tiles from
'darkwater' for these missing tiles.