Plot Geographic Data on a Map in MATLAB
MATLAB® makes it easy to plot data on top of a geographic basemap inside a MATLAB figure. Learn how you can use geographic plotting functions in MATLAB to display points, lines, text, density plots, and bubble charts on top of geographic basemaps. Choose from a range of basemaps available in MATLAB or load specialized web maps from a range of third-party sources. And if you need to create more advanced maps, perform geodesy calculations, or work with geographic file types, check out Mapping Toolbox™.
Published: 26 Dec 2018
Geographic displays provide insight into data with latitude and longitude components. Though you could display your geographic data in MATLAB as a plot of x and y, it will look distorted and won’t contain any contextual information such as political boundaries, roads, and other geographic features.
In MATLAB, geographic base maps can provide this background context when plotting your geographic data. These are tiled, multi-resolution web maps that allow you to pan and zoom on different regions of your plot, automatically loading new base map imagery as you do so.
MATLAB makes it easy to plot data on top of a geographic base map inside a MATLAB figure. There are two types of geographic maps you can make in a MATLAB figure. The simplest is a plot in a geographic axes, which behaves much like a regular MATLAB axes. Use plotting functions along with the hold on command to mix points, lines, text, and density plots in one geoaxes. Here’s an example of this type of plotting. We’ll first use geodensityplot, geoplot, and geoscatter to visualize our density, line, and point data respectively. Then we can customize the view of the data, changing the basemap and the limits, and annotating the plot with text, a legend, and a title.
The second type of geographic map in MATLAB is a geographic bubble chart, which can indicate a continuous variable by bubble size and a categorical variable by bubble color. This is a specialized chart type providing both bubble and categorical legends.
MATLAB’s base maps for global and regional scales are loaded from the web by default, but the data can also be downloaded from MATLAB Add-Ons to be used without an internet connection. Web maps with street-level data, topography, or other specialized base layer representations can be loaded from third-party sources. You can easily add web maps from a range of third-party sources using the addCustomBasemap function, available in Mapping Toolbox.
These functions for overlaying latitude and longitude data on web map base layers are available in MATLAB. If you need to go further, Mapping Toolbox provides additional functions for visualizing data in other projected coordinate systems, converting between systems, and performing geodesy calculations such as calculating distances and areas. Mapping Toolbox also allows you to read and write data between different types of standard geographic file types such as shapefiles, GPX files, and GeoTIFF files.
Featured Product
MATLAB
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)