Data cursor does not show lat and long values in a contourm plot (worldmap function)
Mostrar comentarios más antiguos
I want to overlay a data set into North America. I used MATLAB's worldmap() function to get just North America and used plotm() to plot the coastline of North America from coast.mat(this file also comes with MATLAB). I then used contourm() to plot my data over the coast lines. The code below shows what I did.
hold on
h= worldmap('na');
c = load('coast.mat');
plotm(c.lat,c.long);
contourm(lat,long,value);
"lat" and "long" contain latitude and longitude and are of sizes,lets say 'm' and 'n'. "value" has the data to be plotted which is a matrix of size m x n. The data plots fine but the only problem is that when I use the data cursor, instead of seeing values used in plotting: latitude for "y", longitude for "x" and "value" for z I see really large numbers for x and y and always a 0 for z.
The return from
h=worldmap('na')
shows similar large values for XLimit and YLimit. I tried to change this to the coordinate limits but the graph basically disappeared with out any error.I also tried creating a custom data cursor but I could not get to accurately change the values to geo coordinates.
Any help would be appreciated!
Respuestas (1)
Chad Greene
el 27 de Abr. de 2015
1 voto
4 comentarios
Bipush Osti
el 27 de Abr. de 2015
Chad Greene
el 27 de Abr. de 2015
In what way does it not work?
Bipush Osti
el 28 de Abr. de 2015
Chad Greene
el 28 de Abr. de 2015
Editada: Chad Greene
el 28 de Abr. de 2015
Strange! I'm afraid I don't understand that warning at all. Does this work for you?
hold on
h= worldmap('na');
c = load('coast.mat');
plotm(c.lat,c.long);
z = peaks(180);
[long,lat] = meshgrid(-179:0,89.5:-.5:0);
contourm(lat,long,z);
[lat_loc,lon_loc] = inputm(1);
t = textm(lat_loc,lon_loc,...
['(',num2str(lat_loc),'\circ N, ',num2str(lat_loc),'\circ S)'],...
'vert','middle','horiz','center');
Categorías
Más información sobre MATLAB en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!