How to make a GUIDE axes into a map axes

3 ビュー (過去 30 日間)
Larry Brunson
Larry Brunson 2019 年 3 月 12 日
コメント済み: Walter Roberson 2025 年 2 月 8 日
I have a GUIDE GUI (R2018b) with an axes (h.axes1). I am trying to put a map in it? Should I use axesm? If so, what is the syntax?
  1 件のコメント
rumin diao
rumin diao 2022 年 5 月 26 日
Do you solve the problem? i run into the same problem as you.

サインインしてコメントする。

回答 (1 件)

Aravind
Aravind 2025 年 2 月 8 日
To display a map in your GUIDE GUI (R2018b), you can use the “axesm” function from the Mapping Toolbox. Here's a simple example to explain the syntax and help you get started:
% Assuming h.axes1 is your target axes in the GUIDE GUI
axes(h.axes1); % Activate the target axes
% Create map axes within the target axes
axesm('MapProjection', 'mercator', 'Parent', h.axes1);
% Load and display coastlines
load coastlines; % assuming you have a coastlines mat file
plotm(coastlat, coastlon);
This code sets up a Mercator projection map in your specified axes and plots the coastlines. You can customize the map projection and other properties according to your requirements.
For more details on the “axesm” function, you can run the following command in the MATLAB Command Window:
doc axesm
I hope this helps answer your question!
  1 件のコメント
Walter Roberson
Walter Roberson 2025 年 2 月 8 日
Note that it is not possible to combine a numeric axes with a mapping axes. The closest you can get is to create a new mapping axes with the same location as the numeric axes, and with axes color set to 'none'.

サインインしてコメントする。

タグ

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by