How do I plot points over a topographic map?

13 visualizaciones (últimos 30 días)
Rachel
Rachel el 4 de Nov. de 2013
Comentada: Amy Haskins el 5 de Nov. de 2013
I have plotted a secton of the globe using ETOPO data. I want to plot points onto this surface, but the following "geoshow" command does not work. Does anyone know how to plot like this?
Thanks!
ax = worldmap([20 50],[-130 -65]);
mstruct = gcm;
latlim = [20 50];
lonlim = [-130 -65];
[Z, refvec] = etopo('etopo1_ice_c.flt', 1, latlim, lonlim);
load coast
geoshow(Z, refvec, 'DisplayType', 'surface');
hold on;
%Plot Stations
A = load('Stations.txt');
for ii=1:length(A)
geoshow(A(ii,1),A(ii,2),'Marker','^','MarkerEdgeColor','k','Markersize',4);
hold on;
end

Respuesta aceptada

Amy Haskins
Amy Haskins el 5 de Nov. de 2013
The issue is that when you use display type 'surface' you get a 3D surface. The markers are plotted with Z=0, so they end up hidden. The simplest solution is to use display type 'texturemap'.
geoshow(Z, refvec, 'DisplayType', 'texturemap');
Alternatively, you can give the markers a Z value large enough for them to appear above the surface.
geoshow(40:45, -80:-75, 'DisplayType', 'point', 'Marker', '^', ...
'MarkerEdgeColor','k','Markersize',4, 'Zdata', 10000*ones(6,1))
  3 comentarios
Rachel
Rachel el 5 de Nov. de 2013
Do you also know how to overlay text?
Thank you!
Amy Haskins
Amy Haskins el 5 de Nov. de 2013
Try textm or gtextm. With textm, you can specify the location in lat and lon. With gtextm, you click where you want the text to appear.
textm(42, -75, 'Hello World')

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by